From ce1fc4baa9f7863020d6c5f5c3103d78bd9c41f5 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 29 Jul 2015 16:24:58 -0700 Subject: [PATCH] Send light acks based on CC member --- libraries/networking/src/udt/CongestionControl.h | 1 + libraries/networking/src/udt/Connection.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libraries/networking/src/udt/CongestionControl.h b/libraries/networking/src/udt/CongestionControl.h index 75590d88b5..f8f4860a89 100644 --- a/libraries/networking/src/udt/CongestionControl.h +++ b/libraries/networking/src/udt/CongestionControl.h @@ -68,6 +68,7 @@ private: CongestionControl& operator=(const CongestionControl& other) = delete; int _ackInterval { 0 }; // How many packets to send one ACK, in packets + int _lightACKInterval { 64 }; // How many packets to send one light ACK, in packets int _synInterval { DEFAULT_SYN_INTERVAL }; diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index 935622f4d8..2051ca9627 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -282,6 +282,8 @@ void Connection::processReceivedSequenceNumber(SequenceNumber seq) { // check if we need to send an ACK, according to CC params if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval) { sendACK(false); + } else if (_congestionControl->_lightACKInterval > 0 && _packetsSinceACK >= _congestionControl->_lightACKInterval) { + sendLightACK(); } }