From f9f7d48e72ea8ef00209616ff95fbb2093195bb4 Mon Sep 17 00:00:00 2001 From: Akilan Selvacoumar Date: Mon, 21 Feb 2022 02:38:58 +0400 Subject: [PATCH] added fix to nak interval --- udt/congestion_native.go | 13 ++++++------- udt/udtsocket_send.go | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/udt/congestion_native.go b/udt/congestion_native.go index 44847aa..b774b06 100644 --- a/udt/congestion_native.go +++ b/udt/congestion_native.go @@ -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++ } } diff --git a/udt/udtsocket_send.go b/udt/udtsocket_send.go index 660bffc..5dbc598 100644 --- a/udt/udtsocket_send.go +++ b/udt/udtsocket_send.go @@ -93,6 +93,7 @@ func (s *udtSocketSend) goSendEvent() { } sendPeriod := s.sndPeriod.get() + if sendPeriod == 0 { return nil }