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):
|
def _close_socket(self):
|
||||||
# type: (socket.socket) -> None
|
# type: (socket.socket) -> None
|
||||||
if self.socket:
|
if self.socket:
|
||||||
|
try:
|
||||||
self.socket.shutdown(socket.SHUT_RDWR)
|
self.socket.shutdown(socket.SHUT_RDWR)
|
||||||
self.socket.close()
|
self.socket.close()
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
def disconnect(self, reconnect=True):
|
def disconnect(self, reconnect=True):
|
||||||
# type: (MatrixServer) -> None
|
# type: (MatrixServer) -> None
|
||||||
|
|
Loading…
Add table
Reference in a new issue