慢启动 倍速增长在哪里实现的?

This commit is contained in:
impact-eintr
2022-12-19 18:40:12 +08:00
parent 41ce15ba7b
commit c2dccc5c49
4 changed files with 43 additions and 21 deletions

View File

@@ -49,7 +49,7 @@ func (e *endpoint) WritePacket(r *stack.Route, hdr buffer.Prependable, payload b
// TODO 这里整点活 在特定的情况下丢掉数据报 模拟网络阻塞
e.count++
if e.count == 6 { // 丢掉客户端写入的第二个包
if e.count == -1 { // 丢掉客户端写入的第二个包
logger.NOTICE(fmt.Sprintf("统计 %d 丢掉这个报文", e.count))
return nil
}