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

Allow setting socket parameters #54

Open
bugadani opened this issue Oct 25, 2023 · 1 comment
Open

Allow setting socket parameters #54

bugadani opened this issue Oct 25, 2023 · 1 comment

Comments

@bugadani
Copy link
Contributor

At least timeout and keep_alive would be good to configure

@ShaunSHamilton
Copy link

At least as far as the socket timeout goes, this is controlled by the TCP client (impl TcpConnect) passed to the HttpClient. So, I cannot see a reason for this library to take a mutable ref of the client in order to offer this configuration.

In my case, setting a timeout looked like:

        // ...
        let mut tcp_client = embassy_net::tcp::client::TcpClient::new(stack, &client_state);
        tcp_client.set_timeout(Some(Duration::from_millis(3000)));

        let dns_client = embassy_net::dns::DnsSocket::new(stack);
        let tls_config = reqwless::client::TlsConfig::new(seed, &mut tls_read_buffer, &mut tls_write_buffer, TlsVerify::None);

        let mut http_client = reqwless::client::HttpClient::new_with_tls(&tcp_client, &dns_client, tls_config);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants