-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Can't truly shutdown connection when using close method #29
Comments
The connection shutdown at the time and then reconnected! |
What do your event hooks look like? Sockette will terminate if it received 1000 or 1005 code. So I'm thinking there's something inside the event hooks that's preventing that. |
I got the same issue. Calling close() doesn't seem to close the connection. |
Can you guys try forcing a ws.close(1000) Also, please let me know what browsers & platforms you are/were experiencing this issue. Thanks! |
I'm experiencing the same issue on firefox in my react app.
and then it will reconnect. Also, on 2.0.3 I get unsupported operation error when using the close method |
Thanks, interesting Are you at all able to post a snippet or reproduction so that I can dig into it? Would love to squash this lingering issue |
Got the same issue with react-native. It will automatically reconnect. @lukeed Do you have any experience with react native? I could provide a minimal setup to run in the ios simulator. |
Sure, thank you. I only hear of this issue with RN, so it seems to be specific to that. I'll poke thru the repro when you have it :) Thanks |
Sorry for not providing some code... I had a quick look myself right now and it looks like the error code is always 1001, which is not handled in the onclose handler, so it is calling reconnect again.
1001 is even happening if I do |
@lukeed any chance the PR related to this issue gets merged? |
I'have reverse problem. |
@maxime-guyot sounds like a keep-alive problem. Clients should be pinging the service on an interval shorter than what the server is configured for, or the load balancer in your case. 1001 means something is going away, it doesn't specify client or server. And since every browser will disconnect with a 1001 code when navigating away from the current page, Sockette I can't keep trying to reconnect (since user left) It's basically a matter of not handling client cleanup correctly versus the server cleaning up idle connections. Sockette can't do both, so it helps out by cleaning up after you and ensuring the client terminates correctly. |
In my project, I want to shutdown the connection when I leave out. However, no matter the code I passed to close method, it failed, e.g. ," ws.close(1000, 'out')". Why?
The text was updated successfully, but these errors were encountered: