winpipe

package
v0.0.0-...-a7b2fa3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package winpipe implements a net.Conn and net.Listener around Windows named pipes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(path string, timeout *time.Duration, config *DialConfig) (net.Conn, error)

Dial connects to the specified named pipe by path, timing out if the connection takes longer than the specified duration. If timeout is nil, then we use a default timeout of 2 seconds.

func DialContext

func DialContext(ctx context.Context, path string, config *DialConfig) (net.Conn, error)

DialContext attempts to connect to the specified named pipe by path cancellation or timeout.

func Listen

func Listen(path string, c *ListenConfig) (net.Listener, error)

Listen creates a listener on a Windows named pipe path,such as \\.\pipe\mypipe. The pipe must not already exist.

Types

type DialConfig

type DialConfig struct {
	ExpectedOwner *windows.SID // If non-nil, the pipe is verified to be owned by this SID.
}

DialConfig exposes various options for use in Dial and DialContext.

type ListenConfig

type ListenConfig struct {
	// SecurityDescriptor contains a Windows security descriptor. If nil, the default from RtlDefaultNpAcl is used.
	SecurityDescriptor *windows.SECURITY_DESCRIPTOR

	// MessageMode determines whether the pipe is in byte or message mode. In either
	// case the pipe is read in byte mode by default. The only practical difference in
	// this implementation is that CloseWrite is only supported for message mode pipes;
	// CloseWrite is implemented as a zero-byte write, but zero-byte writes are only
	// transferred to the reader (and returned as io.EOF in this implementation)
	// when the pipe is in message mode.
	MessageMode bool

	// InputBufferSize specifies the initial size of the input buffer, in bytes, which the OS will grow as needed.
	InputBufferSize int32

	// OutputBufferSize specifies the initial size of the output buffer, in bytes, which the OS will grow as needed.
	OutputBufferSize int32
}

ListenConfig contains configuration for the pipe listener.

Jump to

Keyboard shortcuts

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