netx

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("closed")
View Source
var ErrFdGetInvalid = errors.New("fd.Get() returned invalid result")
View Source
var ErrReadNonUnixConn = errors.New("received file is not a UnixConn")

Functions

func FdConn

func FdConn(fd uintptr) (net.Conn, error)

`FdConn(fd)` converts a file descriptor into a `net.Conn`. The original file descriptor will always be closed, even if the conversion fails.

func FileSocketpair

func FileSocketpair() (spc [2]*os.File, err error)

func ReadFdFile

func ReadFdFile(via *net.UnixConn) (*os.File, error)

func ReadFdUnixConn

func ReadFdUnixConn(via *net.UnixConn) (*net.UnixConn, error)

func UnixSocketpair

func UnixSocketpair() (spc [2]*net.UnixConn, err error)

func WriteFdFile

func WriteFdFile(via *net.UnixConn, f *os.File) error

func WriteFdUnixConn

func WriteFdUnixConn(via *net.UnixConn, conn *net.UnixConn) error

Types

type ConnectedConnListener

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

`ConnectedConnListener` is a `net.Listener` that returns one connection on the first call to `Accept()`. Further calls to `Accept()` block until the listener is closed.

func ListenConnectedConn

func ListenConnectedConn(conn net.Conn) *ConnectedConnListener

`ListenConnectedConn()` wraps a connected `net.Conn` such that is can be used as a `net.Listener`.

func (*ConnectedConnListener) Accept

func (lis *ConnectedConnListener) Accept() (net.Conn, error)

func (*ConnectedConnListener) Addr

func (lis *ConnectedConnListener) Addr() net.Addr

func (*ConnectedConnListener) Close

func (lis *ConnectedConnListener) Close() error

Jump to

Keyboard shortcuts

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