package net
import "github.com/containerd/nri/pkg/net"
Index ¶
- func NewConnListener(conn net.Conn) net.Listener
- func NewFdConn(fd int) (net.Conn, error)
- type SocketPair
- func NewSocketPair() (SocketPair, error)
- func (fds SocketPair) Close()
- func (fds SocketPair) LocalClose()
- func (fds SocketPair) LocalConn() (net.Conn, error)
- func (fds SocketPair) LocalFile() *os.File
- func (fds SocketPair) PeerClose()
- func (fds SocketPair) PeerConn() (net.Conn, error)
- func (fds SocketPair) PeerFile() *os.File
Functions ¶
func NewConnListener ¶
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 ¶
NewFdConn creates a net.Conn for the given (socket) fd.
Types ¶
type SocketPair ¶
type SocketPair [2]int
SocketPair contains the file descriptors of a connected pair of sockets.
func NewSocketPair ¶
func NewSocketPair() (SocketPair, error)
NewSocketPair returns a connected pair of sockets.
func (SocketPair) Close ¶
func (fds SocketPair) Close()
Close closes both ends of the socketpair.
func (SocketPair) LocalClose ¶
func (fds SocketPair) LocalClose()
LocalClose closes the local end of the socketpair.
func (SocketPair) LocalConn ¶
func (fds SocketPair) LocalConn() (net.Conn, error)
LocalConn returns a net.Conn for the local end of the socketpair.
func (SocketPair) LocalFile ¶
func (fds SocketPair) LocalFile() *os.File
LocalFile returns the socketpair fd for local usage as an *os.File.
func (SocketPair) PeerClose ¶
func (fds SocketPair) PeerClose()
PeerClose closes the peer end of the socketpair.
func (SocketPair) PeerConn ¶
func (fds SocketPair) PeerConn() (net.Conn, error)
PeerConn returns a net.Conn for the peer end of the socketpair.
func (SocketPair) PeerFile ¶
func (fds SocketPair) PeerFile() *os.File
PeerFile returns the socketpair fd for peer usage as an *os.File.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
pkg/net/multiplex |
- Version
- v0.3.0
- Published
- Feb 25, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 8 hours ago –
Tools for package owners.