|
@ -326,8 +326,11 @@ class AsyncServer(server.Server): |
|
|
Note: this method is a coroutine. |
|
|
Note: this method is a coroutine. |
|
|
""" |
|
|
""" |
|
|
namespace = namespace or '/' |
|
|
namespace = namespace or '/' |
|
|
if (ignore_queue and self.manager.is_connected(sid, namespace)) or \ |
|
|
if ignore_queue: |
|
|
await self.manager.can_disconnect(sid, namespace): |
|
|
do_it = self.manager.is_connected(sid, namespace) |
|
|
|
|
|
else: |
|
|
|
|
|
do_it = await self.manager.can_disconnect(sid, namespace) |
|
|
|
|
|
if do_it: |
|
|
self.logger.info('Disconnecting %s [%s]', sid, namespace) |
|
|
self.logger.info('Disconnecting %s [%s]', sid, namespace) |
|
|
self.manager.pre_disconnect(sid, namespace=namespace) |
|
|
self.manager.pre_disconnect(sid, namespace=namespace) |
|
|
await self._send_packet(sid, packet.Packet(packet.DISCONNECT, |
|
|
await self._send_packet(sid, packet.Packet(packet.DISCONNECT, |
|
@ -440,9 +443,11 @@ class AsyncServer(server.Server): |
|
|
namespace_list = [namespace] |
|
|
namespace_list = [namespace] |
|
|
for n in namespace_list: |
|
|
for n in namespace_list: |
|
|
if n != '/' and self.manager.is_connected(sid, n): |
|
|
if n != '/' and self.manager.is_connected(sid, n): |
|
|
|
|
|
self.manager.pre_disconnect(sid, namespace=namespace) |
|
|
await self._trigger_event('disconnect', n, sid) |
|
|
await self._trigger_event('disconnect', n, sid) |
|
|
self.manager.disconnect(sid, n) |
|
|
self.manager.disconnect(sid, n) |
|
|
if namespace == '/' and self.manager.is_connected(sid, namespace): |
|
|
if namespace == '/' and self.manager.is_connected(sid, namespace): |
|
|
|
|
|
self.manager.pre_disconnect(sid, namespace=namespace) |
|
|
await self._trigger_event('disconnect', '/', sid) |
|
|
await self._trigger_event('disconnect', '/', sid) |
|
|
self.manager.disconnect(sid, '/') |
|
|
self.manager.disconnect(sid, '/') |
|
|
|
|
|
|
|
|