rightserver

package module
v0.0.0-...-c148424 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package rightserver implements a dialer and listener using SCM_RIGHTS and socket pairs. An unnamed unix socket is created for the root client/server. When a new connection is requested by the client, the client creates a socketpair and passes half of the connection to the server via the root client/server socket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSocketConn

func NewSocketConn(fd int) (*net.UnixConn, error)

Types

type Dialer

type Dialer struct {
	// contains filtered or unexported fields
}

func NewDialer

func NewDialer(clientSocket *net.UnixConn) *Dialer

func (*Dialer) Close

func (d *Dialer) Close() error

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Dialer) File

func (d *Dialer) File() (*os.File, error)

File returns an *os.File corresponding to the dialer's socket file. The underlying file descriptor is dup'd and independent of the listener. It is the caller's responsibility to close the file.

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func NewListener

func NewListener(serverSocket *net.UnixConn) *Listener

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the listener's network address.

func (*Listener) Close

func (l *Listener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors.

func (*Listener) File

func (l *Listener) File() (*os.File, error)

File returns an *os.File corresponding to the listener's socket file. The underlying file descriptor is dup'd and independent of the listener. It is the caller's responsibility to close the file.

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

func NewPair

func NewPair() (*Pair, error)

func (*Pair) Dialer

func (p *Pair) Dialer() *Dialer

func (*Pair) Listener

func (p *Pair) Listener() *Listener

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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