You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect to get 2 non-timeout error or 2 timeout ones.
What did you see instead?
"i/o timeout" error when just remote closed connection
"use of closed connection" error when local connection was also closed
Some additional comments
Looking at the net.Conn documentation, it seems like timing out for the Read might be intended behavior
// Read can be made to time out and return an Error with Timeout() == true// after a fixed time limit// [...]// A deadline is an absolute time after which I/O operations// fail with a timeout (see type Error) instead of// blocking. The deadline applies to all future and pending// I/O, not just the immediately following call to Read or// Write.
This probably means that if the remote closed the connection, a Read or Write would still timeout when attempted.
What seems to be a non-intended behavior is to return a non-timeout error after the local side of the Conn is closed.
The text was updated successfully, but these errors were encountered:
It is intentional that when the local side of a network is closed, that an existing Read or Write on that connection should return an error "use of closed network connection". I don't think we want to specify whether you get that error or a timeout error when a deadline has expired. I don't see how that is useful. If there are two possible error conditions, you will get one or the other. We won't specify which one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I would expect to get 2 non-timeout error or 2 timeout ones.
What did you see instead?
Some additional comments
Looking at the net.Conn documentation, it seems like timing out for the Read might be intended behavior
This probably means that if the remote closed the connection, a Read or Write would still timeout when attempted.
What seems to be a non-intended behavior is to return a non-timeout error after the local side of the Conn is closed.
The text was updated successfully, but these errors were encountered: