added fix to nak interval

This commit is contained in:
2022-02-21 02:38:58 +04:00
parent 94ed383489
commit f9f7d48e72
2 changed files with 7 additions and 7 deletions

View File

@@ -31,7 +31,7 @@ func (ncc *NativeCongestionControl) Init(parms CongestionControlParms, synTime t
// This value should be adjusted at runtime according to congestion.
parms.SetACKInterval(4)
ncc.slowStart = false
ncc.lastAck = parms.GetSndCurrSeqNo()
ncc.loss = false
@@ -87,7 +87,7 @@ func (ncc *NativeCongestionControl) OnACK(parms CongestionControlParms, ack pack
}
if ncc.loss {
ncc.loss = false
parms.SetCongestionWindowSize(cWndSize)
//parms.SetCongestionWindowSize(cWndSize)
return
}
/*
@@ -189,14 +189,13 @@ func (ncc *NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist
ncc.nakCount++
if ncc.decRandom != 0 && ncc.nakCount%ncc.decRandom != 0 {
ncc.decCount++
// 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period
parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000)
ncc.lastDecSeq = parms.GetSndCurrSeqNo()
return
}
}
ncc.decCount++
// 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period
parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000)
ncc.lastDecSeq = parms.GetSndCurrSeqNo()
//ncc.decCount++
}
}

View File

@@ -93,6 +93,7 @@ func (s *udtSocketSend) goSendEvent() {
}
sendPeriod := s.sndPeriod.get()
if sendPeriod == 0 {
return nil
}