Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientNamespace calls Client.disconnect incorrectly #259

Closed
sambrightman opened this issue Feb 25, 2019 · 1 comment
Closed

ClientNamespace calls Client.disconnect incorrectly #259

sambrightman opened this issue Feb 25, 2019 · 1 comment
Assignees
Labels

Comments

@sambrightman
Copy link

ClientNamespace does this:

def disconnect(self, namespace=None):
"""Disconnect from the server.
The only difference with the :func:`socketio.Client.disconnect` method
is that when the ``namespace`` argument is not given the namespace
associated with the class is used.
"""
return self.client.disconnect(namespace=namespace or self.namespace)

but Client doesn't take a namespace keyword argument:

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)

It's hard to tell whether Client is intended to take a namespace argument or not, since it appears to always disconnect all namespaces. I get the impression that ClientNamespace.disconnect() should probably not refer to namespaces at all.

@miguelgrinberg
Copy link
Owner

Yes, this is a recent mistake, the disconnect method should not take a namespace. I'll fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants