Skip to content

Fix infinite loop when a Websocket connection is lost - #58

Merged
fhessel merged 1 commit into
fhessel:masterfrom
quentin:ws-lost-issue
Nov 24, 2019
Merged

fhessel merged 1 commit into
fhessel:masterfrom
quentin:ws-lost-issue

Conversation

@quentin

@quentin quentin commented Nov 17, 2019

Copy link
Copy Markdown
Contributor

When a client closes a Websocket connection without performing a clean closing hand-shake, the server enters an infinite loop. This happens when the client web-browser is killed. I noticed this behaviour when swiping out Chrome on Android.

The suggested change might not be the best fix possible, but it works.

@fhessel
fhessel self-requested a review November 17, 2019 14:06
@fhessel

fhessel commented Nov 17, 2019

Copy link
Copy Markdown
Owner

Thank you for your contributions, I'll review them as soon as possible. The WebSocket implementation is still quite experimental, so there might be (or probably will be) more issues with it.

@fhessel fhessel left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could reproduce the problem (using a smartphone and killing the Browser was a good hint) and verify that your suggestion fixes it, so I'd say: Approved!

It might indeed not be an optimal solution to handle the client state in that place, as that is also done at the beginning of the loop() function (here to be precise), but the Websockets in general need some refactoring, so I think that's good for now.

@fhessel
fhessel merged commit f80b961 into fhessel:master Nov 24, 2019
@quentin
quentin deleted the ws-lost-issue branch November 29, 2019 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants