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

websocket should send, and wait for, WS_CLOSE frames on shutdown #1735

Closed
gdamore opened this issue Dec 18, 2023 · 0 comments
Closed

websocket should send, and wait for, WS_CLOSE frames on shutdown #1735

gdamore opened this issue Dec 18, 2023 · 0 comments

Comments

@gdamore
Copy link
Contributor

gdamore commented Dec 18, 2023

RFC 6455 is pretty clear that peers are meant to send a close frame on shutdown, which includes when receiving a close from from a peer.

The idea is that nobody tears down the TCP connection until both sides have received close frames from the other side. (Well sort of ... the second sender can initiate a close once the message is issued and pushed on the wire.)

I'm going to set aside SO_LINGER related issues for the moment and just focus on WS_CLOSE handling.

This was pointed out by @alawn-wang in #1722 - but that PR was a bit incomplete as it only did the send portion without waiting for the peer's close frame to arrive.

Testing the fix for this has uncovered some other issues in the websocket implementation as well.

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

No branches or pull requests

1 participant