Skip to content

Commit 93ca0e4

Browse files
fix: endpoint update scheduler
1 parent 027f501 commit 93ca0e4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/hp/magicsock/conn.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,11 @@ impl Actor {
16021602
self.periodic_re_stun_timer = new_re_stun_timer();
16031603
}
16041604

1605+
self.endpoints_update_state
1606+
.running
1607+
.send(None)
1608+
.expect("sender not go away");
1609+
16051610
debug!("endpoint update done ({})", why);
16061611
}
16071612

@@ -2789,7 +2794,7 @@ fn new_re_stun_timer() -> time::Interval {
27892794
let mut rng = rand::thread_rng();
27902795
let d: Duration = rng.gen_range(Duration::from_secs(20)..=Duration::from_secs(26));
27912796
debug!("scheduling periodic_stun to run in {}s", d.as_secs());
2792-
time::interval(d)
2797+
time::interval_at(time::Instant::now() + d, d)
27932798
}
27942799

27952800
/// Initial connection setup.

0 commit comments

Comments
 (0)