Open nullchinchilla opened 5 years ago
it's non-trivial, changes should consider corresponding notification scheme
if s.kcp.WaitSnd() < waitsnd
// kcp update, returns interval for next calling
func (s *UDPSession) update() (interval time.Duration) {
s.mu.Lock()
waitsnd := s.kcp.WaitSnd()
interval = time.Duration(s.kcp.flush(false)) * time.Millisecond
if s.kcp.WaitSnd() < waitsnd {
s.notifyWriteEvent()
}
s.uncork()
s.mu.Unlock()
return
}
I'm not really sure how this works. When can s.kcp.WaitSnd() < waitsnd {
given the waitsnd := s.kcp.WaitSnd()
above? 可以用中文回覆
When using congestion control, packets continued to be queued up far past the congestion window, all the way to the send window. This cause extreme bufferbloat when congestion control is enabled.
Pull request #140 fixes this issue.