From 49b1e76585393ce542ba2179a241dd87ba577484 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 13 Feb 2016 23:10:51 -0500 Subject: [PATCH] use rtt for ack timeout --- Streaming.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Streaming.cpp b/Streaming.cpp index ab6c6879..a007fc01 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -113,7 +113,9 @@ namespace stream if (!m_IsAckSendScheduled) { m_IsAckSendScheduled = true; - m_AckSendTimer.expires_from_now (boost::posix_time::milliseconds(m_RTT/10)); + auto ackTimeout = m_RTT/10; + if (ackTimeout > ACK_SEND_TIMEOUT) ackTimeout = ACK_SEND_TIMEOUT; + m_AckSendTimer.expires_from_now (boost::posix_time::milliseconds(ackTimeout)); m_AckSendTimer.async_wait (std::bind (&Stream::HandleAckSendTimer, shared_from_this (), std::placeholders::_1)); }