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

FIxed bug with client disconnection.

parent b00b7ee3
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,12 @@ class SimpleRpcServer(ConnectionManager):
conn = self._clients.get(fd)
self._poll.unregister(fd)
if fd is not None:
del self._clients[fd]
conn.shutdown(callback=self._on_disconnect)
try:
del self._clients[fd]
except KeyError:
pass
if conn is not None:
conn.shutdown(callback=self._on_disconnect)
def all_connections(self):
return set(self._clients.values())
......
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