reqwest never close socket connection in windows !

Created on 13 Apr 2018  路  7Comments  路  Source: seanmonstar/reqwest

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);
    }
}
upstream

All 7 comments

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?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  路  6Comments

silvioprog picture silvioprog  路  5Comments

martinlindhe picture martinlindhe  路  3Comments

Arnavion picture Arnavion  路  6Comments

richardanaya picture richardanaya  路  5Comments