shutdown the reading and writing side of the
socket and close it, when we disconnect
This commit is contained in:
parent
81873919c5
commit
7576bb4f3e
|
@ -155,6 +155,12 @@ class NonBlockingTcp(PlugIn, IdleObject):
|
||||||
self.remove_timeout()
|
self.remove_timeout()
|
||||||
self._owner.disconnected()
|
self._owner.disconnected()
|
||||||
self.idlequeue.unplug_idle(self.fd)
|
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
|
# socket descriptor cannot be (un)plugged anymore
|
||||||
self.fd = -1
|
self.fd = -1
|
||||||
if self.on_disconnect:
|
if self.on_disconnect:
|
||||||
|
|
Loading…
Reference in New Issue