More IPv6 support and race condition fixes (#123)

* changes in preparation of wireguard impl

* suggestions by @MDr164
This commit is contained in:
Pat Whittingslow
2026-06-17 15:10:25 -03:00
committed by GitHub
parent 813b7b5e57
commit 60098ad8d0
6 changed files with 130 additions and 36 deletions
+10
View File
@@ -103,6 +103,16 @@ func (conn *Conn) State() State {
return conn.h.State()
}
// AwaitingSynSend reports whether the connection has been opened actively but has
// not yet emitted its SYN. It locks the connection so it is safe to poll from a
// goroutine other than the one driving the stack (unlike reaching through
// [Conn.InternalHandler]).
func (conn *Conn) AwaitingSynSend() bool {
conn.mu.Lock()
defer conn.mu.Unlock()
return conn.h.AwaitingSynSend()
}
// BufferedInput returns the number of bytes in the socket's receive(input) buffer
// and available to read via a [Conn.Read] call.
func (conn *Conn) BufferedInput() int {