You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Main issue:
Calling client.disconnect() ends up triggering disconnect events for all namespaces twice. I think it should be called only once, but wanted to get your opinion.
Flow:
If I call socketio's client.disconnect(), it will call each namespace's disconnect listeners:
Would it be better to just rely on the namespace disconnects getting called from _handle_eio_disconnect() by changing def disconnect() to:
def disconnect(self):
"""Disconnect from the server."""
for n in self.namespaces:
# self._trigger_event('disconnect', namespace=n)
self._send_packet(packet.Packet(packet.DISCONNECT, namespace=n))
# self._trigger_event('disconnect', namespace='/')
self._send_packet(packet.Packet(
packet.DISCONNECT, namespace='/'))
self.eio.disconnect(abort=True)
PS: Thanks for the great library!
The text was updated successfully, but these errors were encountered:
Main issue:
Calling
client.disconnect()
ends up triggering disconnect events for all namespaces twice. I think it should be called only once, but wanted to get your opinion.Flow:
If I call socketio's
client.disconnect()
, it will call each namespace's disconnect listeners:python-socketio/socketio/client.py
Lines 329 to 337 in 1fb1f6d
It then calls engineio's disconnect:
https://github.com/miguelgrinberg/python-engineio/blob/d6a33d22cfd3ebe8b4d78cd5c27607de837d16e9/engineio/client.py#L191-L211
Which then ends up calling all the namespace's disconnects again:
python-socketio/socketio/client.py
Lines 525 to 535 in 1fb1f6d
Would it be better to just rely on the namespace disconnects getting called from
_handle_eio_disconnect()
by changingdef disconnect()
to:PS: Thanks for the great library!
The text was updated successfully, but these errors were encountered: