readv/recvmsg ETIMEDOUT can happen even without SO_RCVTIMEO.
In tcp, this can happen when the kernel gives up on retransmitting a previously submitted write. In this case, kernel assigns ETIMEDOUT (or a deferred error) to sk_err, and all subsequent socket operations will return error from sk_err.
Triggering this can be as easy as unplugging the client from power/ethernet.
I already tested this on aarch64-macos and it triggers unexpected errno 60.
Im using name error.PeerUnresponsive instead of error.Timeout because this error has a different meaning.
When a user calls read, the only reason they expect a Timeout error is from a user‐defined timeout (e.g., operateTimeout). However, this error occurs not because of the current operation, but because of a previous operation. Therefore, using Timeout would be confusing.
Ideally, all send/write/receive/read operations should have this error, but i want to get error name and whole idea approved before modifying them.
readv/recvmsg `ETIMEDOUT` can happen even without [`SO_RCVTIMEO`](https://codeberg.org/ziglang/zig/pulls/31901/files#issuecomment-13235340).
In tcp, this can happen when the kernel gives up on retransmitting a previously submitted write. In this case, kernel [assigns `ETIMEDOUT` (or a deferred error) to sk_err](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_timer.c#n79), and all subsequent socket operations will return error from sk_err.
Triggering this can be as easy as unplugging the client from power/ethernet.
I already tested this on `aarch64-macos` and it triggers `unexpected errno 60`.
Im using name `error.PeerUnresponsive` instead of `error.Timeout` because this error has a different meaning.
When a user calls `read`, the only reason they expect a `Timeout` error is from a user‐defined timeout (e.g., `operateTimeout`). However, this error occurs not because of the current operation, but because of a previous operation. Therefore, using `Timeout` would be confusing.
Ideally, all send/write/receive/read operations should have this error, but i want to get error name and whole idea approved before modifying them.