winpipe

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func NewListener(inner net.Listener) net.Listener

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL