MCPcopy Create free account
hub / github.com/Haivision/srt / checkACKTimer

Method checkACKTimer

srtcore/core.cpp:11912–11949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11910}
11911
11912int srt::CUDT::checkACKTimer(const steady_clock::time_point &currtime)
11913{
11914 int because_decision = BECAUSE_NO_REASON;
11915 if (currtime > m_tsNextACKTime.load() // ACK time has come
11916 // OR the number of sent packets since last ACK has reached
11917 // the congctl-defined value of ACK Interval
11918 // (note that none of the builtin congctls defines ACK Interval)
11919 || (m_CongCtl->ACKMaxPackets() > 0 && m_iPktCount >= m_CongCtl->ACKMaxPackets()))
11920 {
11921 // ACK timer expired or ACK interval is reached
11922 sendCtrl(UMSG_ACK);
11923
11924 const steady_clock::duration ack_interval = m_CongCtl->ACKTimeout_us() > 0
11925 ? microseconds_from(m_CongCtl->ACKTimeout_us())
11926 : m_tdACKInterval;
11927 m_tsNextACKTime.store(currtime + ack_interval);
11928
11929 m_iPktCount = 0;
11930 m_iLightACKCount = 1;
11931 because_decision = BECAUSE_ACK;
11932 }
11933
11934 // Or the transfer rate is so high that the number of packets
11935 // have reached the value of SelfClockInterval * LightACKCount before
11936 // the time has come according to m_tsNextACKTime. In this case a "lite ACK"
11937 // is sent, which doesn't contain statistical data and nothing more
11938 // than just the ACK number. The "fat ACK" packets will be still sent
11939 // normally according to the timely rules.
11940 else if (m_iPktCount >= SELF_CLOCK_INTERVAL * m_iLightACKCount)
11941 {
11942 // send a "light" ACK
11943 sendCtrl(UMSG_ACK, NULL, NULL, SEND_LITE_ACK);
11944 ++m_iLightACKCount;
11945 because_decision = BECAUSE_LITEACK;
11946 }
11947
11948 return because_decision;
11949}
11950
11951int srt::CUDT::checkNAKTimer(const steady_clock::time_point& currtime)
11952{

Callers

nothing calls this directly

Calls 5

microseconds_fromFunction · 0.85
ACKMaxPacketsMethod · 0.80
ACKTimeout_usMethod · 0.80
loadMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected