Skip to content
Snippets Groups Projects
Commit 7576bb4f authored by dkirov's avatar dkirov
Browse files

shutdown the reading and writing side of the

socket and close it, when we disconnect
parent 81873919
No related branches found
No related tags found
No related merge requests found
......@@ -155,6 +155,12 @@ class NonBlockingTcp(PlugIn, IdleObject):
self.remove_timeout()
self._owner.disconnected()
self.idlequeue.unplug_idle(self.fd)
try:
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()
except:
# socket is already closed
pass
# socket descriptor cannot be (un)plugged anymore
self.fd = -1
if self.on_disconnect:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment