Browse Source
properly handle disconnects from ios client
pull/319/head
Miguel Grinberg
6 years ago
No known key found for this signature in database
GPG Key ID: 36848B262DF5F06C
2 changed files with
4 additions and
4 deletions
-
socketio/asyncio_server.py
-
socketio/server.py
|
|
@ -409,8 +409,6 @@ class AsyncServer(server.Server): |
|
|
|
if namespace == '/' and self.manager.is_connected(sid, namespace): |
|
|
|
await self._trigger_event('disconnect', '/', sid) |
|
|
|
self.manager.disconnect(sid, '/') |
|
|
|
if sid in self.environ: |
|
|
|
del self.environ[sid] |
|
|
|
|
|
|
|
async def _handle_event(self, sid, namespace, id, data): |
|
|
|
"""Handle an incoming client event.""" |
|
|
@ -505,6 +503,8 @@ class AsyncServer(server.Server): |
|
|
|
async def _handle_eio_disconnect(self, sid): |
|
|
|
"""Handle Engine.IO disconnect event.""" |
|
|
|
await self._handle_disconnect(sid, '/') |
|
|
|
if sid in self.environ: |
|
|
|
del self.environ[sid] |
|
|
|
|
|
|
|
def _engineio_server_class(self): |
|
|
|
return engineio.AsyncServer |
|
|
|
|
|
@ -583,8 +583,6 @@ class Server(object): |
|
|
|
if namespace == '/' and self.manager.is_connected(sid, namespace): |
|
|
|
self._trigger_event('disconnect', '/', sid) |
|
|
|
self.manager.disconnect(sid, '/') |
|
|
|
if sid in self.environ: |
|
|
|
del self.environ[sid] |
|
|
|
|
|
|
|
def _handle_event(self, sid, namespace, id, data): |
|
|
|
"""Handle an incoming client event.""" |
|
|
@ -673,6 +671,8 @@ class Server(object): |
|
|
|
def _handle_eio_disconnect(self, sid): |
|
|
|
"""Handle Engine.IO disconnect event.""" |
|
|
|
self._handle_disconnect(sid, '/') |
|
|
|
if sid in self.environ: |
|
|
|
del self.environ[sid] |
|
|
|
|
|
|
|
def _engineio_server_class(self): |
|
|
|
return engineio.Server |
|
|
|