tokio-core icon indicating copy to clipboard operation
tokio-core copied to clipboard

Discussion: Dual-stack footguns

Open Ralith opened this issue 7 years ago • 4 comments

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?

Ralith avatar Jun 26 '17 06:06 Ralith

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?

carllerche avatar Jul 05 '17 20:07 carllerche

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 avatar Jul 05 '17 21:07 alexcrichton

@alexcrichton do you remember what that was?

carllerche avatar Aug 17 '17 17:08 carllerche

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

alexcrichton avatar Aug 17 '17 20:08 alexcrichton