[Waiting for modification] add conn idle timeout#2827
[Waiting for modification] add conn idle timeout#2827silence-coding wants to merge 1 commit intohyperium:masterfrom
Conversation
77fc762 to
d2545a2
Compare
|
This is only a demo to check whether there is a big problem in selecting the time point for connection timeout. I'll re-implement one later on, based on the community's recommendations. |
|
@paolobarbolini Do you have any good suggestions for me? |
|
Spelling? Missing idle_timeot: Arc<Mutex<Pin<Box<Sleep>>>>Also is changing log = "0.4.14"And why not use: if let Err(_) = timeout(Duration::from_secs(10), fut).await {
println!("did not receive value within 10 seconds");
}https://docs.rs/tokio/latest/tokio/time/fn.timeout.html |
@deputinizer Thank you very much, and I'll take the time to submit a formal pull request later, with the corresponding tests and comments. This submission is my feasibility verification of this function, so I write it casually. My main concern is that there may be problems with this core implementation, especially for h2, resulting in a major rewrite of the submitted code. |
|
@deputinizer Can you tell me which line of code it is? |
With the idle time configurable we can prevent a pile up of open connections which never see any activity. See also on the hyper issue tracker: ``` hyperium/hyper#3743 hyperium/hyper#1628 hyperium/hyper#2355 hyperium/hyper#2827 ```
#2355
I'd like to ask if it's appropriate to carry out an idle check in these