more effort into understanding why TAP interface is so slow on my linux machine to no avail

This commit is contained in:
soypat
2025-06-05 00:47:07 -03:00
parent bc14ed395d
commit 6ba727a0ef
12 changed files with 256 additions and 26 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ type ControlBlock struct {
challengeAck bool
}
// State returns the current state of the TCP connection.
// State returns the current state of the TCP connection. See [State].
func (tcb *ControlBlock) State() State { return tcb._state }
// RecvNext returns the next sequence number expected to be received from remote.
+6 -4
View File
@@ -308,15 +308,17 @@ func (s State) IsSynchronized() bool {
return s >= StateEstablished && !s.IsClosed()
}
// txOpen returns true if the TCP state machine allows data to be sent by user.
func (s State) txOpen() bool {
// TxDataOpen returns true if the state allows for outgoing data segments to be sent.
// Combine with [State.IsPreestablished] to know whether there is no more data to be sent over the network.
func (s State) TxDataOpen() bool {
// In CloseWait state the remote endpoint has closed
// our receive hald of the connection but we can still transmit indefinitely.
return s == StateEstablished || s == StateCloseWait
}
// rxOpen returns true if the TCP state machine allows data to be received from remote endpoint.
func (s State) rxOpen() bool {
// RxDataOpen returns true if the state allows the receiving of incoming data segments.
// Combine with [State.IsPreestablished] to know whether there is no more data to be received over the network.
func (s State) RxDataOpen() bool {
return s == StateEstablished || s == StateFinWait1 || s == StateFinWait2
}