tcp可靠性实现 抄了一堆东西 信息量太大了 看不过来

This commit is contained in:
impact-eintr
2022-12-13 16:17:57 +08:00
parent fb578a6f9e
commit 5a9042d890
12 changed files with 700 additions and 23 deletions

View File

@@ -46,6 +46,7 @@ func (v *Value) UpdateForward(s Size) {
}
// Overlap checks if the window [a,a+b) overlaps with the window [x, x+y).
// [a,x+y)&&[x, a+b) [a, x, a+b, x+y) [a, x, x+y, a+b) [x, a, a+b, x+y) [x, a, x+y, a+b)
func Overlap(a Value, b Size, x Value, y Size) bool {
return a.LessThan(x.Add(y)) && x.LessThan(a.Add(b))
}