CreateEventTimer: Implement CallStrategy

There are two CallStrategies:

- BestEffort (default): Will try to get your event to trigger at the specified
  interval, but will refuse to queue handlers if a handler takes too
  long.
- Precise: Will enqueue event handlers at the exact interval specified.
  Can lead to the queue filling up if the handler takes longer than the
  interval.
This commit is contained in:
Lion Kortlepel
2022-03-31 20:13:59 +02:00
parent 81dbf747d5
commit d4b30a2583
3 changed files with 90 additions and 23 deletions

View File

@@ -514,6 +514,7 @@ void TNetwork::Looper(const std::weak_ptr<TClient>& c) {
}
}
}
void TNetwork::TCPClient(const std::weak_ptr<TClient>& c) {
// TODO: the c.expired() might cause issues here, remove if you end up here with your debugger
if (c.expired() || c.lock()->GetTCPSock() == -1) {