Closed
Description
Creating a TCP listener socket will result in error under Windows 7. Minimal test case:
fn main() {
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:8000").unwrap();
}
This will produce an error with code 10041 (WSAEPROTOTYPE
).
This was tested on stable Rust (1.0.0).
After a bit digging, turns out this particular piece of code might be the cause of the breakage. According to the Winsock docs, The WSA_FLAG_NO_HANDLE_INHERIT
flag is supported on at least Windows 7 SP1, so running on vanilla Windows 7 would not work and would apparently break your program.