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

Implement complete close handshake #160

Merged
merged 5 commits into from
Oct 9, 2019
Merged

Implement complete close handshake #160

merged 5 commits into from
Oct 9, 2019

Conversation

nhooyr
Copy link
Contributor

@nhooyr nhooyr commented Oct 7, 2019

I changed my mind after #103 as browsers include a wasClean field in the close event to indicate
whether the connection was closed cleanly. From my tests, if a server using
this library prior to this commit initiates the close handshake, wasClean
will be false for the browser as the connection was closed before it could
respond with a close frame. Thus, I believe it's necessary to fully implement
the close handshake.

@stephenyama You'll enjoy this.

Closes #161

@FZambia
Copy link

FZambia commented Oct 7, 2019

@nhooyr one more case where this is important: we had problems with Swift WebSocket libraries which disconnect with Abnormal closure status code if closing handshake was not properly done and sending closing frame from client get a TCP RST on balancer as connection have been already closed by server.

@nhooyr nhooyr mentioned this pull request Oct 7, 2019
@nhooyr
Copy link
Contributor Author

nhooyr commented Oct 7, 2019

@nhooyr one more case where this is important: we had problems with Swift WebSocket libraries which disconnect with Abnormal closure status code if closing handshake was not properly done and sending closing frame from client get a TCP RST on balancer as connection have been already closed by server.

Sounds good. Glad to hear this will fix that.

I changed my mind after #103 as browsers include a wasClean event to indicate
whether the connection was closed cleanly. From my tests, if a server using
this library prior to this commit initiates the close handshake, wasClean
will be false for the browser as the connection was closed before it could
respond with a close frame. Thus, I believe it's necessary to fully implement
the close handshake.

@stephenyama You'll enjoy this.
@nhooyr nhooyr force-pushed the close branch 3 times, most recently from 0c77bfe to 4fc87a5 Compare October 9, 2019 00:44
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.

CloseError wrapping
2 participants