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

fix: properly handle full closing handshake #47

Open
mccutchen opened this issue Feb 21, 2025 · 0 comments
Open

fix: properly handle full closing handshake #47

mccutchen opened this issue Feb 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mccutchen
Copy link
Owner

Right now, when our websocket server initiates the closing handshake, it does not wait for the client to reply before closing the connection, which is a (mild?) violation of the protocol.

Bonus mystery: It seems like the autobahn test suite should probably cover this, but we're passing those tests with our incomplete implementation. Could this be related to the mystery of why the server never seems to actually close the underlying TCP connection in our test suite?

websocket/websocket_test.go

Lines 325 to 331 in aa7a462

// FIXME: this write should fail, but the connection doesn't seem to
// get closed. for now we skip.
if false {
wn, err := conn.Write([]byte("foo"))
assert.Equal(t, wn, 0, "expected to write 0 bytes")
assert.Error(t, err, net.ErrClosed)
}

@mccutchen mccutchen added the bug Something isn't working label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant