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

Forced Disconnect - Client Side Issue #513

Closed
austinh opened this issue Sep 8, 2011 · 14 comments
Closed

Forced Disconnect - Client Side Issue #513

austinh opened this issue Sep 8, 2011 · 14 comments
Labels
bug Something isn't working

Comments

@austinh
Copy link

austinh commented Sep 8, 2011

When using the socket.disconnect(); function from the server to force a client to disconnect, the client (when using XHR-Polling) continues to constantly send requests to the server. Not tested with WebSockets, but also possible issue there. Is this a bug? Or intended?

If this is intended, what is the correct way to force a client to disconnect (from the server), and stop any and all connections with the socket.io server.

@austinh
Copy link
Author

austinh commented Sep 10, 2011

Any response to this? I'm not 100% sure if this is a bug or intended. If it's a bug, I'd be glad to help fix it.

Edit: Damnit...The "Comment and Close" button is huge, I keep hitting it! I reopened the case because of my silly mistake.

@austinh austinh closed this as completed Sep 10, 2011
@austinh austinh reopened this Sep 10, 2011
@bminer
Copy link

bminer commented Nov 23, 2011

+1 There is currently no documented way to properly kick / punt / boot a client. It makes me sad... I want to rudely punt my clients; politely asking them to disconnect is boring.

@chrisdew
Copy link

chrisdew commented Dec 5, 2011

+1 This would help me too.

@nh2
Copy link

nh2 commented Jan 1, 2012

Is this a duplicate of issue #47? I think it is about the same question.

@austinh
Copy link
Author

austinh commented Jan 1, 2012

I guess it is a duplicate. Is there an official way to disconnect a client?

@bminer
Copy link

bminer commented Jan 2, 2012

Yes, this is a duplicate of #47, but there is still no official, documented API function to disconnect/punt a client.

@Sembiance
Copy link

I have a test case for this problem, I attached it to issue #438

See: https://github.com/Sembiance/client_not_handshaken_test_case

@Jimflip
Copy link

Jimflip commented Jan 10, 2012

+1 I really need this also.

@austinh
Copy link
Author

austinh commented Feb 16, 2012

Any update on this? Maybe this will be available when socket.io's codebase migrates to engine.io?

@Josh1billion
Copy link

+1, this seems like an important feature. I want to accomplish it as well, and so far I haven't found a good workaround yet.

You can send the client a message requesting that they disconnect, but what happens if they don't listen to it? I suppose you'd need to add your own variable to the socket, such as "valid", set it to true when the client connects and false when they disconnect, and only process messages when valid is true. Even then, they're still taking up your server's download bandwidth (though I suppose they could do that just by reconnecting anyway).

@chrisbnt
Copy link

+1, would I be right to assume this is non-trivial in some of the supported transports?

@bminer
Copy link

bminer commented May 24, 2012

@barn3y - I could be way wrong here, but it's probably pretty trivial, actually. I think it's as simple as sending the client a special DISCONNECT message and then just disconnecting & ignoring future requests from that client. The client then has to worry about cleaning up as it normally would if you called disconnect() on the client. Or, maybe I'm way off... haven't looked at the socket.io source in a while.

@nh2
Copy link

nh2 commented Jun 16, 2012

#47 seems to be done.

@scanales
Copy link

Having the same issue, did any of you guys come up with a decent workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants