mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 18:57:50 +01:00
added fix to nak interval
This commit is contained in:
@@ -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++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ func (s *udtSocketSend) goSendEvent() {
|
||||
}
|
||||
|
||||
sendPeriod := s.sndPeriod.get()
|
||||
|
||||
if sendPeriod == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user