mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
fix for re-send timeout in SendQueue
This commit is contained in:
parent
8985427516
commit
58f9830a94
3 changed files with 5 additions and 1 deletions
|
@ -91,6 +91,7 @@ SendQueue& Connection::getSendQueue() {
|
||||||
|
|
||||||
// set defaults on the send queue from our congestion control object and estimatedTimeout()
|
// set defaults on the send queue from our congestion control object and estimatedTimeout()
|
||||||
_sendQueue->setPacketSendPeriod(_congestionControl->_packetSendPeriod);
|
_sendQueue->setPacketSendPeriod(_congestionControl->_packetSendPeriod);
|
||||||
|
_sendQueue->setSyncInterval(_synInterval);
|
||||||
_sendQueue->setEstimatedTimeout(estimatedTimeout());
|
_sendQueue->setEstimatedTimeout(estimatedTimeout());
|
||||||
_sendQueue->setFlowWindowSize(std::min(_flowWindowSize, (int) _congestionControl->_congestionWindowSize));
|
_sendQueue->setFlowWindowSize(std::min(_flowWindowSize, (int) _congestionControl->_congestionWindowSize));
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,7 +439,8 @@ bool SendQueue::isInactive(bool sentAPacket) {
|
||||||
} else {
|
} else {
|
||||||
// We think the client is still waiting for data (based on the sequence number gap)
|
// We think the client is still waiting for data (based on the sequence number gap)
|
||||||
// Let's wait either for a response from the client or until the estimated timeout
|
// Let's wait either for a response from the client or until the estimated timeout
|
||||||
auto waitDuration = std::chrono::microseconds(_estimatedTimeout);
|
// (plus the sync interval to allow the client to respond) has elapsed
|
||||||
|
auto waitDuration = std::chrono::microseconds(_estimatedTimeout + _syncInterval);
|
||||||
|
|
||||||
// use our condition_variable_any to wait
|
// use our condition_variable_any to wait
|
||||||
auto cvStatus = _emptyCondition.wait_for(locker, waitDuration);
|
auto cvStatus = _emptyCondition.wait_for(locker, waitDuration);
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
void setPacketSendPeriod(int newPeriod) { _packetSendPeriod = newPeriod; }
|
void setPacketSendPeriod(int newPeriod) { _packetSendPeriod = newPeriod; }
|
||||||
|
|
||||||
void setEstimatedTimeout(int estimatedTimeout) { _estimatedTimeout = estimatedTimeout; }
|
void setEstimatedTimeout(int estimatedTimeout) { _estimatedTimeout = estimatedTimeout; }
|
||||||
|
void setSyncInterval(int syncInterval) { _syncInterval = syncInterval; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void stop();
|
void stop();
|
||||||
|
@ -114,6 +115,7 @@ private:
|
||||||
std::atomic<State> _state { State::NotStarted };
|
std::atomic<State> _state { State::NotStarted };
|
||||||
|
|
||||||
std::atomic<int> _estimatedTimeout { 0 }; // Estimated timeout, set from CC
|
std::atomic<int> _estimatedTimeout { 0 }; // Estimated timeout, set from CC
|
||||||
|
std::atomic<int> _syncInterval { udt::DEFAULT_SYN_INTERVAL_USECS }; // Sync interval, set from CC
|
||||||
std::atomic<int> _timeoutExpiryCount { 0 }; // The number of times the timeout has expired without response from client
|
std::atomic<int> _timeoutExpiryCount { 0 }; // The number of times the timeout has expired without response from client
|
||||||
std::atomic<uint64_t> _lastReceiverResponse { 0 }; // Timestamp for the last time we got new data from the receiver (ACK/NAK)
|
std::atomic<uint64_t> _lastReceiverResponse { 0 }; // Timestamp for the last time we got new data from the receiver (ACK/NAK)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue