快速重传

This commit is contained in:
impact-eintr
2022-12-27 17:44:45 +08:00
parent 823e76e979
commit 5e99462726
5 changed files with 15 additions and 17 deletions

View File

@@ -51,7 +51,7 @@ func (e *endpoint) WritePacket(r *stack.Route, hdr buffer.Prependable, payload b
//time.Sleep(time.Duration(rand.Intn(50)+50) * time.Millisecond)
e.count++
if e.count == 10 { // 丢掉客户端写入的第二个包
if e.count == 6 { // 丢掉客户端写入的第二个包
logger.NOTICE(fmt.Sprintf("统计 %d 丢掉这个报文", e.count))
return nil
}