From d937cf1cc7b78338830893a3f0b4dd5b3a3542d4 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 3 Aug 2015 15:05:41 -0700 Subject: [PATCH] set RTT on congestion control in ctor --- libraries/networking/src/udt/Connection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index 1786f7558e..1fb4a7db9c 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -37,8 +37,12 @@ Connection::Connection(Socket* parentSocket, HifiSockAddr destination, unique_pt // setup default SYN, RTT and RTT Variance based on the SYN interval in CongestionControl object _synInterval = _congestionControl->synInterval(); + _rtt = _synInterval * 10; _rttVariance = _rtt / 2; + + // set the initial RTT on congestion control object + _congestionControl->setRTT(_rtt); } Connection::~Connection() { @@ -375,7 +379,7 @@ void Connection::processACK(std::unique_ptr controlPacket) { microseconds sinceLastACK2 = duration_cast(currentTime - lastACK2SendTime); - if (sinceLastACK2.count() > _synInterval || currentACKSubSequenceNumber == _lastSentACK2) { + if (sinceLastACK2.count() >= _synInterval || currentACKSubSequenceNumber == _lastSentACK2) { // Send ACK2 packet sendACK2(currentACKSubSequenceNumber);