Closed
Description
use std::net::TcpStream;
use std::time::Duration;
fn main() {
let sock = "127.0.0.1:1234".parse().unwrap();
let timeout = Duration::from_secs(3);
TcpStream::connect_timeout(&sock, timeout).unwrap();
}
This program succeeds on Linux, even though it shouldn't (assuming you don't have a listener on 1234). Trying to do anything with the socket produces Error { repr: Os { code: 107, message: "Transport endpoint is not connected" } }
.