netfd

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWouldBlock error = syscall.EWOULDBLOCK

Functions

func ParseToSockAddr

func ParseToSockAddr(addr string) (unix.Sockaddr, error)

func SockaddrToTCPAddr

func SockaddrToTCPAddr(sa unix.Sockaddr) *net.TCPAddr

Types

type FD

type FD interface {
	io.Reader
	io.Writer
	io.Closer
	SetKeepAlivePeriod(d time.Duration) error
	SetKeepAlive(bool) error
	SetFastOpen(b bool) error
	SetReusePort(b bool) error
	SetReuseAddr(b bool) error
	OK() bool
	LocalAddr() *net.TCPAddr
	RemoteAddr() *net.TCPAddr
	ReadFull(b []byte) (n int, err error)
	Peek(b []byte) (n int, err error)
	Accept(SetNonBlocking bool) (FD, *net.TCPAddr, error)
	Addr() *net.TCPAddr
	SetNonBlocking(bool) error
	SetNoDelay(bool) error
	Int() int
	Bind(sa unix.Sockaddr) error
	Connect(sa unix.Sockaddr) error
	BindToDevice(dev string) error
	Listen(backlog int) error
	Stat() (*syscall.Stat_t, error)
}

func NetFD

func NetFD(fd int) FD

func New

func New(network string) (FD, error)

Jump to

Keyboard shortcuts

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