Commit 3b25b83c authored by Antoine Millet's avatar Antoine Millet

FIxed bug with client disconnection.

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