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