连接的建立 数据的收发 施工中。。。

This commit is contained in:
impact-eintr
2023-01-04 11:31:11 +08:00
parent 5d0a9c3721
commit bda9357103
8 changed files with 1127 additions and 31 deletions

View File

@@ -425,9 +425,9 @@ func (e *endpoint) Write(p tcpip.Payload, opts tcpip.WriteOptions) (uintptr, <-c
l := len(v)
s := newSegmentFromView(&e.route, e.id, v) // 分段
// 插入发送队列
e.sndBufUsed += l
e.sndBufInQueue += seqnum.Size(l)
e.sndQueue.PushBack(s)
e.sndBufUsed += l // 发送队列中段+1
e.sndBufInQueue += seqnum.Size(l) // 发送队列长度+length
e.sndQueue.PushBack(s) // 将段压入发送队列
e.sndBufMu.Unlock()