Commit f41b6ab7 authored by Antoine Millet's avatar Antoine Millet

Better disconnection handling.

parent d6a7106b
......@@ -177,7 +177,8 @@ class ConnectionManager(object):
'''
fd = connection.get_fd()
self._poll.modify(fd, ConnectionManager.MASK_WRITABLE)
if fd is not None:
self._poll.modify(fd, ConnectionManager.MASK_WRITABLE)
def nothing_to_write(self, connection):
'''
......@@ -189,7 +190,8 @@ class ConnectionManager(object):
'''
fd = connection.get_fd()
self._poll.modify(fd, ConnectionManager.MASK_NORMAL)
if fd is not None:
self._poll.modify(fd, ConnectionManager.MASK_NORMAL)
def handle_event(self, fd, event):
'''
......
......@@ -428,8 +428,10 @@ class RpcConnection(object):
:return: the file descriptor number of the socket
'''
return self._sock.fileno()
try:
return self._sock.fileno()
except socket.error:
return None
def getpeername(self):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment