You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
I read through some of the other issues on timers in romio, but it seemed slightly different than changing the underlying mio/net2 settings. I want to open a large number of TCP connections to different hosts, which may or may not respond. In order to prevent an excessive number of open files on the client I want to configure aggressive connection timeouts to prune connections that don't respond quickly.
I'd be happy to try to submit a PR to add a Builder object or something to make TcpStream more configurable, but I'm not sure if there is somewhere I should be looking for an example of this. (I'm digging into the Rust async/await story, and I'm not experienced in it yet.)
Here's a brief snippet that shows the code I'm using -- I appear to be hanging onto connections that fail for some time, and if there is an alternate path to fix I'd be happy to try that out instead.
fnmain() -> io::Result<()>{let delay = 1e9asu64 / REQUESTS_PER_SECOND;
executor::block_on(async{for _ in0..TOTAL_REQUESTS{
juliex::spawn(asyncmove{let addr = random_addr(80);matchTcpStream::connect(addr).await{Ok(mut stream) => {
stream.write_all(&REQUEST).await.expect("Failed to write to socket")
stream.close().await.expect("Failed to close socket");println!("Success: {:?}",&addr);}Err(e) => {eprintln!("Failed to connect: '{}'", e);}}});}});Ok(())}
Hi there,
I read through some of the other issues on timers in
romio, but it seemed slightly different than changing the underlyingmio/net2settings. I want to open a large number of TCP connections to different hosts, which may or may not respond. In order to prevent an excessive number of open files on the client I want to configure aggressive connection timeouts to prune connections that don't respond quickly.I'd be happy to try to submit a PR to add a
Builderobject or something to makeTcpStreammore configurable, but I'm not sure if there is somewhere I should be looking for an example of this. (I'm digging into the Rust async/await story, and I'm not experienced in it yet.)Here's a brief snippet that shows the code I'm using -- I appear to be hanging onto connections that fail for some time, and if there is an alternate path to fix I'd be happy to try that out instead.
Thanks!
Ryan