| 1596 | } |
| 1597 | |
| 1598 | void Stream::ScheduleSend () |
| 1599 | { |
| 1600 | if (m_Status != eStreamStatusTerminated) |
| 1601 | { |
| 1602 | m_SendTimer.cancel (); |
| 1603 | uint64_t interval = SEND_INTERVAL + m_LocalDestination.GetRandom () % SEND_INTERVAL_VARIANCE; |
| 1604 | if (interval < m_PacingTime) interval = m_PacingTime; |
| 1605 | m_SendTimer.expires_after (std::chrono::microseconds(interval)); |
| 1606 | m_SendTimer.async_wait (std::bind (&Stream::HandleSendTimer, |
| 1607 | shared_from_this (), std::placeholders::_1)); |
| 1608 | } |
| 1609 | } |
| 1610 | |
| 1611 | void Stream::HandleSendTimer (const boost::system::error_code& ecode) |
| 1612 | { |