Skip to content

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.

nhooyr added 3 commits October 8, 2019 20:28
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