-
Notifications
You must be signed in to change notification settings - Fork 303
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
SetDeadline should only close the connection if there is an in progress Read/Write #228
Comments
This is documented on Unfortunately nothing can be done about it as closing the connection is the only way to unblock any reading/writing goroutines as this library treats the underlying connection as The reasoning behind this is that net/http's Client only gives us back a Another reason is that when http2 upgrades are supported, we'd also only have access to a So while on the server we could theoretically access the SetDeadline methods on the net.Conn for HTTP/1, it's best not to depend on them at all. |
Actually I see your point, we could only close the connection if there is an in progress read/write but otherwise we don't have to. |
NetConn has to close the connection to interrupt in progress reads and writes. However, it can error out on reads and writes that occur after the deadline instead of closing the connection. Closes #228
NetConn has to close the connection to interrupt in progress reads and writes. However, it can error out on reads and writes that occur after the deadline instead of closing the connection. Closes #228
NetConn has to close the connection to interrupt in progress reads and writes. However, it can block reads and writes that occur after the deadline instead of closing the connection. Closes #228
I'm using
websocket.NetConn
.net.Conn
docs say:However this closes the connection 10s after the write, even if the write has already completed:
The text was updated successfully, but these errors were encountered: