reqwest
reqwest copied to clipboard
connect_timeout not firing an error
I have set connect_timeout() and would expect the future to Err once the timeout expires but I am seeing my program hang indefinitely.
I can reproduce it with any unreachable IP on my LAN:
use std::time::Duration;
#[tokio::main]
async fn main() {
let client = reqwest::ClientBuilder::new()
.connect_timeout(Duration::from_millis(1000))
.build().unwrap();
// Unreachable IP address
client.get("http://192.168.1.8:5053").send().await.unwrap();
}
Am I missing something or do you think this is a bug?
Using [email protected].
Could be a bug, could be something more happening on your system. Hard to know, since the option does work for many people. Are you able to dig into what may be different?