net

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnListener

func NewConnListener(conn net.Conn) net.Listener

NewConnListener wraps an existing net.Conn in a net.Listener.

The first call to Accept() on the listener will return the wrapped connection. Subsequent calls to Accept() block until the listener is closed, then return io.EOF. Close() closes the listener and the wrapped connection.

func NewFdConn

func NewFdConn(fd int) (net.Conn, error)

NewFdConn creates a net.Conn for the given (socket) fd.

Types

type SocketPair

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

SocketPair contains the os.File of a connected pair of sockets.

func NewSocketPair

func NewSocketPair() (SocketPair, error)

NewSocketPair returns a connected pair of sockets.

func (SocketPair) Close

func (sp SocketPair) Close()

Close closes both ends of the socketpair.

func (SocketPair) LocalClose

func (sp SocketPair) LocalClose()

LocalClose closes the local end of the socketpair.

func (SocketPair) LocalConn

func (sp SocketPair) LocalConn() (net.Conn, error)

LocalConn returns a net.Conn for the local end of the socketpair. This closes LocalFile().

func (SocketPair) LocalFile

func (sp SocketPair) LocalFile() *os.File

LocalFile returns the local end of the socketpair as an *os.File.

func (SocketPair) PeerClose

func (sp SocketPair) PeerClose()

PeerClose closes the peer end of the socketpair.

func (SocketPair) PeerConn

func (sp SocketPair) PeerConn() (net.Conn, error)

PeerConn returns a net.Conn for the peer end of the socketpair. This closes PeerFile().

func (SocketPair) PeerFile

func (sp SocketPair) PeerFile() *os.File

PeerFile returns the peer end of the socketpair as an *os.File.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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