fixed issue where timer could set negative value in repeat if heavily delayed
This commit is contained in:
parent
f7317ab4f1
commit
19d82ed1f2
|
|
@ -263,8 +263,9 @@ private:
|
||||||
// it's time for the next heartbeat
|
// it's time for the next heartbeat
|
||||||
_connection->heartbeat();
|
_connection->heartbeat();
|
||||||
|
|
||||||
// remember when we should send out the next one
|
// remember when we should send out the next one, so the next one should be
|
||||||
_next += std::max(_timeout / 2, 1);
|
// sent only after _timout/2 seconds again _from now_ (no catching up)
|
||||||
|
_next = now + std::max(_timeout / 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset the timer to trigger again later
|
// reset the timer to trigger again later
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue