Closed
Description
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
Metadata
Metadata
Assignees
Labels
Area: `std::io`, `std::fs`, `std::net` and `std::path`Category: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Help is requested to fix this issue.Operating system: WindowsRelevant to the library team, which will review and decide on the PR/issue.