Skip to content

ClientNamespace calls Client.disconnect incorrectly #259

@sambrightman

Description

@sambrightman

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.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions