mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:16:20 +02:00
only de-activate the SendQueue when it has nothing to send
This commit is contained in:
parent
cf28fdf188
commit
8a2c31d342
1 changed files with 0 additions and 22 deletions
|
@ -538,28 +538,6 @@ bool SendQueue::maybeResendPacket() {
|
||||||
bool SendQueue::isInactive(bool attemptedToSendPacket) {
|
bool SendQueue::isInactive(bool attemptedToSendPacket) {
|
||||||
// check for connection timeout first
|
// check for connection timeout first
|
||||||
|
|
||||||
// that will be the case if we have had 16 timeouts since hearing back from the client, and it has been
|
|
||||||
// at least 5 seconds
|
|
||||||
static const int NUM_TIMEOUTS_BEFORE_INACTIVE = 16;
|
|
||||||
static const int MIN_MS_BEFORE_INACTIVE = 5 * 1000;
|
|
||||||
|
|
||||||
auto sinceLastResponse = (QDateTime::currentMSecsSinceEpoch() - _lastReceiverResponse);
|
|
||||||
|
|
||||||
if (sinceLastResponse > 0 &&
|
|
||||||
sinceLastResponse >= int64_t(NUM_TIMEOUTS_BEFORE_INACTIVE * (_estimatedTimeout / USECS_PER_MSEC)) &&
|
|
||||||
sinceLastResponse > MIN_MS_BEFORE_INACTIVE) {
|
|
||||||
// If the flow window has been full for over CONSIDER_INACTIVE_AFTER,
|
|
||||||
// then signal the queue is inactive and return so it can be cleaned up
|
|
||||||
|
|
||||||
#ifdef UDT_CONNECTION_DEBUG
|
|
||||||
qCDebug(networking) << "SendQueue to" << _destination << "reached" << NUM_TIMEOUTS_BEFORE_INACTIVE << "timeouts"
|
|
||||||
<< "and" << MIN_MS_BEFORE_INACTIVE << "milliseconds before receiving any ACK/NAK and is now inactive. Stopping.";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
deactivate();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!attemptedToSendPacket) {
|
if (!attemptedToSendPacket) {
|
||||||
// During our processing above we didn't send any packets
|
// During our processing above we didn't send any packets
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue