use a monotonous timer for the connection (#3570)

There's no point in having the timer fire multiple times for the same
timestamp. By using a monotonuos timer we avoid busy-looping in cases where the
timer fires, but we can't actually send a packet.
This commit is contained in:
Marten Seemann
2022-10-11 15:36:10 +03:00
committed by GitHub
parent 2b5d1281c1
commit ee013d9d23
5 changed files with 137 additions and 18 deletions

View File

@@ -47,6 +47,10 @@ func (t *Timer) SetRead() {
t.read = true
}
func (t *Timer) Deadline() time.Time {
return t.deadline
}
// Stop stops the timer
func (t *Timer) Stop() {
t.t.Stop()