Closed Esqarrouth closed 5 years ago
- How can I debug this problem better?
There is not much you can do about it because it's not an issue. It's a condition you have to deal with.
- What are common cases which might be causing this problem?
A close frame is not received, likely because it was not sent.
Btw, update at least to https://github.com/websockets/ws/releases/tag/6.1.3. The bug fixed there is relevant and important.
Nvm, the 3.x release line should not be affected by that but it doesn't harm anyway to update, if you can.
I'm tracking the disconnections used ws 3.3.1 until 3 March then updated ws to 6.1.4. I am adding the charts.
Conclusion:
I hope this is the expected behaviour?
Yes, 1005 is a close frame with an empty payload.
- How can I debug this problem better?
There is not much you can do about it because it's not an issue. It's a condition you have to deal with.
- What are common cases which might be causing this problem?
A close frame is not received, likely because it was not sent.
- You mean it is not an issue with ws, right?
Yes, I'm not aware of ws dropping close frames.
- What do you mean there is not much you can do about it?
It's outside of your control. You can't force the client to send a close frame. If this is coming from a browser try to call ws.close()
before the page unload and see if it makes any difference.
- What do you mean it's a condition you have to deal with? If it is common, how do you or other people generally deal with this issue?
Treat it for what it is. An "abnormal" closure.
- Do you mean that socket server didn't send the close frame to client?
The client.
Description
I'm logging disconnects in my web game. It seems 75% of the sessions are getting disconnected with the code 1001 (normal) and 25% are getting disconnected with the code 1006 (error). https://tools.ietf.org/html/rfc6455
Sometimes on the error reason I see this text:
But he majority of 1006 disconnects don't give any reason at all. The players just disconnect with no reason at all. This usually happens at 5-30 minutes mark while the player is actively playing the game.
The setup I'm has these:
My question is:
Reproducible in:
Also posted in: https://stackoverflow.com/questions/54909597/websocket-disconnects-with-1006-error-without-a-reason