mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 12:00:11 +02:00
use last adjustment time to adjust every RTT
This commit is contained in:
parent
0d2e83e0fc
commit
7cc1f3261e
2 changed files with 4 additions and 3 deletions
|
@ -54,7 +54,8 @@ bool TCPVegasCC::onACK(SequenceNumber ack) {
|
|||
// find the min RTT during the last RTT
|
||||
_currentMinRTT = std::min(_currentMinRTT, lastRTT);
|
||||
|
||||
if (ack >= _lastAdjustmentNextSendAck) {
|
||||
auto sinceLastAdjustment = duration_cast<microseconds>(now - _lastAdjustmentTime).count();
|
||||
if (sinceLastAdjustment >= _ewmaRTT) {
|
||||
performCongestionAvoidance(ack);
|
||||
}
|
||||
|
||||
|
@ -152,7 +153,7 @@ void TCPVegasCC::performCongestionAvoidance(udt::SequenceNumber ack) {
|
|||
_congestionWindowSize = std::min(_congestionWindowSize, VEGAS_CW_MIN_PACKETS);
|
||||
|
||||
// mark this as the last adjustment time
|
||||
_lastAdjustmentNextSendAck = _sendCurrSeqNum;
|
||||
_lastAdjustmentTime = p_high_resolution_clock::now();
|
||||
|
||||
// reset our state for the next RTT
|
||||
_currentMinRTT = std::numeric_limits<int>::max();
|
||||
|
|
|
@ -44,7 +44,7 @@ private:
|
|||
using PacketTimeList = std::map<SequenceNumber, TimeSizePair>;
|
||||
PacketTimeList _sentPacketTimes; // Map of sequence numbers to sent time
|
||||
|
||||
SequenceNumber _lastAdjustmentNextSendAck; // Sequence number of next packet to be sent at time of last adjustment
|
||||
p_high_resolution_clock::time_point _lastAdjustmentTime; // Time of last congestion control adjustment
|
||||
|
||||
bool _slowStart { false }; // Marker for slow start phase
|
||||
|
||||
|
|
Loading…
Reference in a new issue