-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Server-side namespaced disconnect #795
Comments
|
I have the following setup:
Note, that I do not disconnect the namespace two namespaced socket. However, on the client both on('disconnect') events will fire. PS: output of socket.io
|
I see. That's definitely a bug! |
Actually, from looking at the source code it looks more like a "feature": https://github.com/LearnBoost/socket.io/blob/master/lib/socket.js#L290 There doesn't seem to be any code to handle that use-case. |
Yep, that's definitely something we need to change =] Thanks for bringing this up |
I played around a bit and it seems that doing the following will actually perform a graceful namespaced disconnect:
It does not take into account what happens, if the namespace was the last namespace the client was connected to though. But as I think about it, I don't think anything special should happen when the client disconnects from the last namespace, since it will still be connected to the global namespace anyway. Also I thin there is another bug, that is not directly related but I found while doing research on this bug: if a client disconnects from a namespace you would expect it to also leave all rooms associated with that namespace. This is not the case though. I will open up another issue and describe that more in details there. |
The second commit fixes the problem. |
…owdock * refs/remotes/learnboost/master: Release 0.9.5 Added test for polling with connection close. Ensure close upon request close. Fix disconnection reason being lost for polling transports. Ensure that polling transports work with Connection: close Log disconnection reason Release 0.9.4 Release 0.9.4 Release 0.9.4 Release 0.9.3 Firefox will try to parse the response from POST requests, causing a syntax error message in the Web Console. Basically an addition to socketio#501 Fix issue socketio#795 Add disconnect from namespace test-case for issue socketio#795 Conflicts: lib/transports/http.js package.json
Can this be closed? |
why do not fix this problems "client namespace disconnect". i never call disconnect event normal process. but call disconnect it is very trouble to all developers.!! |
WHY This issue was closed. |
this is still happening immediately after connecting. here's my implementation:
i have verbose debugging enabled but can't see any errors in the console, so i can see that it connects then immediately disconnects. the frontend logs:
the server logs: nothing is telling to to disconnect. |
As far as I can tell disconnecting from a namespace is only possible from the client side. It does not seem to be possible to disconnect a client from just a namespace from the server side.
Forced disconnection from the server is an essential feature. Multiplexing over a single connection is hampered a lot if a server can only disconnect a client from all namespaces at once. E.g. a module based on socket.io might disconnect a socket if something goes wrong badly. One couldn't pull in that module and use it on a multiplexed connection in it's own namespace without it interfering with other stuff going on on that connection.
The code for dealing with namespaced disconnects essentially is present. The protocol also specifies it. And it is already possible, from the client side.
What do you guys think?
The text was updated successfully, but these errors were encountered: