Catch exceptions while trying to close the socket.
This commit is contained in:
parent
475feaa93a
commit
41c96fd332
1 changed files with 5 additions and 2 deletions
|
@ -316,8 +316,11 @@ class MatrixServer:
|
|||
def _close_socket(self):
|
||||
# type: (socket.socket) -> None
|
||||
if self.socket:
|
||||
self.socket.shutdown(socket.SHUT_RDWR)
|
||||
self.socket.close()
|
||||
try:
|
||||
self.socket.shutdown(socket.SHUT_RDWR)
|
||||
self.socket.close()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def disconnect(self, reconnect=True):
|
||||
# type: (MatrixServer) -> None
|
||||
|
|
Loading…
Add table
Reference in a new issue