Skip to content
Snippets Groups Projects
Commit f41b6ab7 authored by Antoine Millet's avatar Antoine Millet
Browse files

Better disconnection handling.

parent d6a7106b
No related branches found
No related tags found
No related merge requests found
......@@ -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):
'''
......
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