ping_time is once again used to define the ping intervals

This commit is contained in:
Aaron Weiss 2020-07-23 13:35:43 -04:00
parent 99591ffeb0
commit 7ac4585871
No known key found for this signature in database
GPG key ID: 047D32DF25DC22EF

View file

@ -37,13 +37,14 @@ struct Pinger {
impl Pinger {
/// Construct a new pinger helper.
pub fn new(tx: UnboundedSender<Message>, config: &Config) -> Pinger {
let ping_time = Duration::from_secs(u64::from(config.ping_time()));
let ping_timeout = Duration::from_secs(u64::from(config.ping_timeout()));
Self {
tx,
ping_timeout,
ping_deadline: None,
ping_interval: time::interval(ping_timeout / 2),
ping_interval: time::interval(ping_time),
}
}