Skip to content

Commit

Permalink
Merge pull request #2483 from imachug/gevent-ws-fix
Browse files Browse the repository at this point in the history
Potential fix of BrokenPipeError
  • Loading branch information
HelloZeroNet authored Mar 17, 2020
2 parents 6beb76e + ba156bb commit 3156d2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/gevent_ws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ def _error(self, status):

def close(self, status=STATUS_OK):
self.closed = True
self._send_frame(OPCODE_CLOSE, struct.pack("!H", status))
try:
self._send_frame(OPCODE_CLOSE, struct.pack("!H", status))
except (BrokenPipeError, ConnectionResetError):
pass
self.socket.close()


Expand Down

0 comments on commit 3156d2f

Please sign in to comment.