Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reqwest never close socket connection in windows ! #284

Closed
woodgear opened this issue Apr 13, 2018 · 8 comments
Closed

reqwest never close socket connection in windows ! #284

woodgear opened this issue Apr 13, 2018 · 8 comments
Labels
B-upstream Blocked: upstream. Depends on a dependency to make a change first.

Comments

@woodgear
Copy link

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);
    }
}
@seanmonstar
Copy link
Owner

This only occurs in Windows, not on Linux? Could be related to this tokio-rs/mio#776

@woodgear woodgear changed the title reqwest never close socket connection in windows ?! reqwest never close socket connection in windows ! Apr 13, 2018
@woodgear
Copy link
Author

is there some way i can avoid this for now?

@seanmonstar seanmonstar added the B-upstream Blocked: upstream. Depends on a dependency to make a change first. label Aug 8, 2018
@ghost
Copy link

ghost commented Aug 12, 2019

Running into the same issue, any updates on this?

@oherrala
Copy link

@woodgear
Copy link
Author

still exists in reqwest = "0.9.24"

@oherrala
Copy link

tokio 0.3 has been released and it includes mio 0.7. Updating tokio (and mio) might help fix issue.

@woodgear
Copy link
Author

wow, this comment makes me remind the old time 😂. glad to see it be fixed.

@theduke
Copy link
Contributor

theduke commented Mar 17, 2021

Upstream issue has been fixed.

Can this be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-upstream Blocked: upstream. Depends on a dependency to make a change first.
Projects
None yet
Development

No branches or pull requests

4 participants