tokio-core
tokio-core copied to clipboard
Discussion: Dual-stack footguns
On Linux, communicating with IPv4 hosts using an IPv6 socket will typically Just Work. However, on Windows it will produce a mysterious WSAEFAULT
error unless IPV6_V6ONLY
is explicitly turned off in advance. Linux can also be configured to default that option on, and OpenBSD does not permit it to be turned off at all.
Should tokio (or mio) make an effort to provide clearer error messages and/or a consistent default behavior in this circumstance?
I would say yes for the TcpStream types that are provided as they are intended to be friendly / portable. This seems like a similar problem that std TcpStream would have as well?
I somewhat recall this coming up in discussions in the standard library historically, and I'd imagine we should just mirror what libstd does.
@alexcrichton do you remember what that was?
I'm thinking of https://github.com/rust-lang/rust/pull/34440 (which I've now dug up). The conclusion there was that libstd didn't change, which to me means that we probably don't want to change tokio-core