|
|
@ -76,14 +76,17 @@ namespace stream |
|
|
|
m_AckSendTimer (m_Service), m_NumSentBytes (0), m_NumReceivedBytes (0), m_Port (port), |
|
|
|
m_AckSendTimer (m_Service), m_NumSentBytes (0), m_NumReceivedBytes (0), m_Port (port), |
|
|
|
m_RTT (INITIAL_RTT), m_WindowSize (INITIAL_WINDOW_SIZE), m_RTO (INITIAL_RTO), |
|
|
|
m_RTT (INITIAL_RTT), m_WindowSize (INITIAL_WINDOW_SIZE), m_RTO (INITIAL_RTO), |
|
|
|
m_AckDelay (local.GetOwner ()->GetStreamingAckDelay ()), m_PrevRTTSample (INITIAL_RTT), |
|
|
|
m_AckDelay (local.GetOwner ()->GetStreamingAckDelay ()), m_PrevRTTSample (INITIAL_RTT), |
|
|
|
m_PrevRTT (INITIAL_RTT), m_Jitter (0), m_MinPacingTime (0), |
|
|
|
m_PrevRTT (INITIAL_RTT), m_Jitter (0), m_MinPacingTime (MIN_PACING_TIME), |
|
|
|
m_PacingTime (INITIAL_PACING_TIME), m_NumResendAttempts (0), m_MTU (STREAMING_MTU) |
|
|
|
m_PacingTime (INITIAL_PACING_TIME), m_NumResendAttempts (0), m_MTU (STREAMING_MTU) |
|
|
|
{ |
|
|
|
{ |
|
|
|
RAND_bytes ((uint8_t *)&m_RecvStreamID, 4); |
|
|
|
RAND_bytes ((uint8_t *)&m_RecvStreamID, 4); |
|
|
|
m_RemoteIdentity = remote->GetIdentity (); |
|
|
|
m_RemoteIdentity = remote->GetIdentity (); |
|
|
|
auto outboundSpeed = local.GetOwner ()->GetStreamingOutboundSpeed (); |
|
|
|
auto outboundSpeed = local.GetOwner ()->GetStreamingOutboundSpeed (); |
|
|
|
if (outboundSpeed) |
|
|
|
if (outboundSpeed) |
|
|
|
m_MinPacingTime = (1000000LL*STREAMING_MTU)/outboundSpeed; |
|
|
|
{ |
|
|
|
|
|
|
|
auto minPacingTime = (1000000LL*STREAMING_MTU)/outboundSpeed; |
|
|
|
|
|
|
|
if (minPacingTime > m_MinPacingTime) m_MinPacingTime = minPacingTime; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Stream::Stream (boost::asio::io_service& service, StreamingDestination& local): |
|
|
|
Stream::Stream (boost::asio::io_service& service, StreamingDestination& local): |
|
|
@ -94,13 +97,16 @@ namespace stream |
|
|
|
m_ReceiveTimer (m_Service), m_SendTimer (m_Service), m_ResendTimer (m_Service), m_AckSendTimer (m_Service), |
|
|
|
m_ReceiveTimer (m_Service), m_SendTimer (m_Service), m_ResendTimer (m_Service), m_AckSendTimer (m_Service), |
|
|
|
m_NumSentBytes (0), m_NumReceivedBytes (0), m_Port (0), m_RTT (INITIAL_RTT), |
|
|
|
m_NumSentBytes (0), m_NumReceivedBytes (0), m_Port (0), m_RTT (INITIAL_RTT), |
|
|
|
m_WindowSize (INITIAL_WINDOW_SIZE), m_RTO (INITIAL_RTO), m_AckDelay (local.GetOwner ()->GetStreamingAckDelay ()), |
|
|
|
m_WindowSize (INITIAL_WINDOW_SIZE), m_RTO (INITIAL_RTO), m_AckDelay (local.GetOwner ()->GetStreamingAckDelay ()), |
|
|
|
m_PrevRTTSample (INITIAL_RTT), m_PrevRTT (INITIAL_RTT), m_Jitter (0), m_MinPacingTime (0), |
|
|
|
m_PrevRTTSample (INITIAL_RTT), m_PrevRTT (INITIAL_RTT), m_Jitter (0), m_MinPacingTime (MIN_PACING_TIME), |
|
|
|
m_PacingTime (INITIAL_PACING_TIME), m_NumResendAttempts (0), m_MTU (STREAMING_MTU) |
|
|
|
m_PacingTime (INITIAL_PACING_TIME), m_NumResendAttempts (0), m_MTU (STREAMING_MTU) |
|
|
|
{ |
|
|
|
{ |
|
|
|
RAND_bytes ((uint8_t *)&m_RecvStreamID, 4); |
|
|
|
RAND_bytes ((uint8_t *)&m_RecvStreamID, 4); |
|
|
|
auto outboundSpeed = local.GetOwner ()->GetStreamingOutboundSpeed (); |
|
|
|
auto outboundSpeed = local.GetOwner ()->GetStreamingOutboundSpeed (); |
|
|
|
if (outboundSpeed) |
|
|
|
if (outboundSpeed) |
|
|
|
m_MinPacingTime = (1000000LL*STREAMING_MTU)/outboundSpeed; |
|
|
|
{ |
|
|
|
|
|
|
|
auto minPacingTime = (1000000LL*STREAMING_MTU)/outboundSpeed; |
|
|
|
|
|
|
|
if (minPacingTime > m_MinPacingTime) m_MinPacingTime = minPacingTime; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Stream::~Stream () |
|
|
|
Stream::~Stream () |
|
|
|