tunnel: document TAP goroutine lifecycle on disconnect
The TAP→Server goroutine can't be interrupted (TAP fd doesn't support deadlines). It exits on next TAP frame when WriteFrames fails on the closed connection. Document this rather than add complexity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b2ef8bc1bf
commit
bbeeb8c41b
1 changed files with 3 additions and 0 deletions
|
|
@ -134,6 +134,9 @@ func (t *Tunnel) Bridge(tapRead func(buf []byte) (int, error), tapWrite func(buf
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// TAP → Server
|
// TAP → Server
|
||||||
|
// Note: tapRead blocks on the TAP fd which doesn't support deadlines.
|
||||||
|
// On disconnect, this goroutine survives until the next TAP frame arrives,
|
||||||
|
// at which point WriteFrames fails on the closed connection and it exits.
|
||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 1600)
|
buf := make([]byte, 1600)
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue