server: Close the socket even if shutdown() raises an exception.
This commit is contained in:
parent
fbf56d3491
commit
a46a50fd74
1 changed files with 5 additions and 1 deletions
|
@ -459,10 +459,14 @@ class MatrixServer(object):
|
|||
if self.socket:
|
||||
try:
|
||||
self.socket.shutdown(socket.SHUT_RDWR)
|
||||
self.socket.close()
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.socket.close()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def disconnect(self, reconnect=True):
|
||||
# type: (bool) -> None
|
||||
if self.fd_hook:
|
||||
|
|
Loading…
Reference in a new issue