ping_time is once again used to define the ping intervals
This commit is contained in:
parent
99591ffeb0
commit
7ac4585871
1 changed files with 2 additions and 1 deletions
|
@ -37,13 +37,14 @@ struct Pinger {
|
||||||
impl Pinger {
|
impl Pinger {
|
||||||
/// Construct a new pinger helper.
|
/// Construct a new pinger helper.
|
||||||
pub fn new(tx: UnboundedSender<Message>, config: &Config) -> Pinger {
|
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()));
|
let ping_timeout = Duration::from_secs(u64::from(config.ping_timeout()));
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
tx,
|
tx,
|
||||||
ping_timeout,
|
ping_timeout,
|
||||||
ping_deadline: None,
|
ping_deadline: None,
|
||||||
ping_interval: time::interval(ping_timeout / 2),
|
ping_interval: time::interval(ping_time),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue