Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/socketio/async_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ async def _connect(self, eio_sid, namespace):
), namespace=self.admin_namespace)
return sid

async def _disconnect(self, sid, namespace, **kwargs):
async def _disconnect(self, sid, namespace, reason, **kwargs):
del self.sio.manager._timestamps[sid]
await self.sio.emit('socket_disconnected', (
namespace,
sid,
'N/A',
reason or 'N/A',
datetime.utcnow().isoformat() + 'Z',
), namespace=self.admin_namespace)
return await self.sio.manager.__disconnect(sid, namespace, **kwargs)
Expand Down Expand Up @@ -292,9 +292,9 @@ async def _handle_eio_connect(self, eio_sid, environ):
self.event_buffer.push('rawConnection')
return await self.sio._handle_eio_connect(eio_sid, environ)

async def _handle_eio_disconnect(self, eio_sid):
async def _handle_eio_disconnect(self, eio_sid, reason):
self.event_buffer.push('rawDisconnection')
return await self.sio._handle_eio_disconnect(eio_sid)
return await self.sio._handle_eio_disconnect(eio_sid, reason)

def _eio_http_response(self, packets=None, headers=None, jsonp_index=None):
ret = self.sio.eio.__ok(packets=packets, headers=headers,
Expand Down
2 changes: 1 addition & 1 deletion src/socketio/async_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ async def _handle_disconnect(self, eio_sid, namespace, reason=None):
self.manager.pre_disconnect(sid, namespace=namespace)
await self._trigger_event('disconnect', namespace, sid,
reason or self.reason.CLIENT_DISCONNECT)
await self.manager.disconnect(sid, namespace, ignore_queue=True)
await self.manager.disconnect(sid, namespace, reason=reason or self.reason.CLIENT_DISCONNECT, ignore_queue=True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?


async def _handle_event(self, eio_sid, namespace, id, data):
"""Handle an incoming client event."""
Expand Down