Hello! 👋
I tried this code on Windows:
use std::net::{TcpStream, ToSocketAddrs};
use std::time::Duration;
fn main() {
let address_result = "google.com:80".to_socket_addrs();
let address = address_result.unwrap().next().unwrap();
TcpStream::connect_timeout(&address, Duration::MAX).expect("Google is offline?!");
println!("Never gets here on Windows (https://github.com/rust-lang/rust/issues/112405).");
}
I expected to see this happen: Success for an available address like google.com:80 and blocking forever (or until TCP timeout) for hostname.invalid:80 just like on Linux.
Instead, this happened: the call never succeeds, not even for google.com:80 on Windows.
Related: hartwork/rust-for-it@5056e69
Meta
rustc --version --verbose:
# rustc --version --verbose
rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-pc-windows-msvc
release: 1.69.0
LLVM version: 15.0.7
Hello! 👋
I tried this code on Windows:
I expected to see this happen: Success for an available address like
google.com:80and blocking forever (or until TCP timeout) forhostname.invalid:80just like on Linux.Instead, this happened: the call never succeeds, not even for
google.com:80on Windows.Related: hartwork/rust-for-it@5056e69
Meta
rustc --version --verbose: