send request peer 1 seconds and the socket connection never closed.
the example code is above. is there some config i miss?
#[test]
fn test_port_close() {
use std::thread::sleep_ms;
loop {
let default_client = reqwest::Client::builder()
.timeout(Duration::from_secs(60))
.build()
.unwrap();
let mut headers = Headers::new(); //some header
headers.set_raw("organization-id", "mock");
headers.set_raw("terminalid", "mock");
let res = default_client
.get("http://192.168.3.167:10000/ClientApp/manifest") //my server
.headers(headers)
.send().unwrap()
.text().unwrap();
println!("res {:?}", res);
sleep_ms(1 * 1000);
}
}
This only occurs in Windows, not on Linux? Could be related to this https://github.com/carllerche/mio/issues/776
is there some way i can avoid this for now?
Running into the same issue, any updates on this?
@boyerjohn There seem to be fix for mio.
See:
still exists in reqwest = "0.9.24"
tokio 0.3 has been released and it includes mio 0.7. Updating tokio (and mio) might help fix issue.
wow, this comment makes me remind the old time 馃槀. glad to see it be fixed.