mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
send a light ACK every 64, not each after 64
This commit is contained in:
parent
826c8d5150
commit
bc5ddd3837
2 changed files with 8 additions and 1 deletions
|
@ -73,6 +73,9 @@ void Connection::sendReliablePacket(unique_ptr<Packet> packet) {
|
||||||
|
|
||||||
void Connection::sync() {
|
void Connection::sync() {
|
||||||
if (_hasReceivedFirstPacket) {
|
if (_hasReceivedFirstPacket) {
|
||||||
|
// reset the number of light ACKS during this sync interval
|
||||||
|
_lightACKsDuringSYN = 1;
|
||||||
|
|
||||||
// we send out a periodic ACK every rate control interval
|
// we send out a periodic ACK every rate control interval
|
||||||
sendACK();
|
sendACK();
|
||||||
|
|
||||||
|
@ -322,8 +325,10 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
|
||||||
// check if we need to send an ACK, according to CC params
|
// check if we need to send an ACK, according to CC params
|
||||||
if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval) {
|
if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval) {
|
||||||
sendACK(false);
|
sendACK(false);
|
||||||
} else if (_congestionControl->_lightACKInterval > 0 && _packetsSinceACK >= _congestionControl->_lightACKInterval) {
|
} else if (_congestionControl->_lightACKInterval > 0
|
||||||
|
&& _packetsSinceACK >= _congestionControl->_lightACKInterval * _lightACKsDuringSYN) {
|
||||||
sendLightACK();
|
sendLightACK();
|
||||||
|
++_lightACKsDuringSYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wasDuplicate) {
|
if (wasDuplicate) {
|
||||||
|
|
|
@ -97,6 +97,8 @@ private:
|
||||||
SequenceNumber _lastSentACK; // The last sent ACK
|
SequenceNumber _lastSentACK; // The last sent ACK
|
||||||
SequenceNumber _lastSentACK2; // The last sent ACK sub-sequence number in an ACK2
|
SequenceNumber _lastSentACK2; // The last sent ACK sub-sequence number in an ACK2
|
||||||
|
|
||||||
|
int _lightACKsDuringSYN { 1 }; // The number of lite ACKs sent during SYN interval
|
||||||
|
|
||||||
int32_t _rtt; // RTT, in microseconds
|
int32_t _rtt; // RTT, in microseconds
|
||||||
int32_t _rttVariance; // RTT variance
|
int32_t _rttVariance; // RTT variance
|
||||||
int _flowWindowSize { udt::MAX_PACKETS_IN_FLIGHT }; // Flow control window size
|
int _flowWindowSize { udt::MAX_PACKETS_IN_FLIGHT }; // Flow control window size
|
||||||
|
|
Loading…
Reference in a new issue