Documentation
¶
Overview ¶
Package winpipe opens the Windows named-pipe listeners plexd serves on: the local node API and the WireGuard UAPI. It wraps the listener of golang.zx2c4.com/wireguard/ipc/namedpipe so that Close returns in every order of events.
That listener's Close hands one signal to the listener's goroutine and then waits for the goroutine to finish. While an Accept is in flight the goroutine can take the signal and live on: it treats the aborted connect as a close only when ConnectNamedPipe reported nil or a cancelled completion. Measured on Windows Server 2025 for plexsphere/plexd#236, two other results reach it. ConnectNamedPipe returns ERROR_OPERATION_ABORTED itself when the cancel lands before the kernel has queued the connect, and the goroutine then hands that error to Accept and waits for a signal that was already spent. ConnectNamedPipe returns ERROR_NO_DATA when a client connected and left before it ran, and the goroutine then waits for the next client. In both, Close blocks for good, and so does an http.Server.Shutdown above it, which closes its listeners before it looks at its context.
The wrapper file carries no build tag, so its tests run on every platform against a stand-in for that listener.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewListener ¶
NewListener wraps the named-pipe listener inner. Close on the result returns once inner has shut down, in every order of Accept, Close and client connects, and Accept reports net.ErrClosed for any error inner returns after Close began.
Types ¶
This section is empty.