socket

package
v0.0.0-...-fc031ab Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPassive = iota
	StatusConnected
	StatusConnecting
	StatusListening
	StatusClosed
)
View Source
const (
	InitiatorUndefined = iota
	InitiatorProcess
	InitiatorExternal
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

type Socket struct {
	Domain int
	FD     *fd.FD
	// contains filtered or unexported fields
}

func NewSocket

func NewSocket(domain int, typ int) (*Socket, error)

func (*Socket) Accept

func (s *Socket) Accept(flags int) (*Socket, syscall.Errno, error)

func (*Socket) Bind

func (s *Socket) Bind(addr netip.AddrPort) (syscall.Errno, error)

Bind binds the socket to the given address. Internally, it uses a dummy temporary socket in order to check if the address is bindable and also reserve the address for future operations.

func (*Socket) BindAddr

func (s *Socket) BindAddr() (netip.AddrPort, syscall.Errno, error)

func (*Socket) Close

func (s *Socket) Close() syscall.Errno

func (*Socket) Connect

func (s *Socket) Connect(addr netip.AddrPort) (syscall.Errno, error)

func (*Socket) Errno

func (s *Socket) Errno() unix.Errno

func (*Socket) Listen

func (s *Socket) Listen(backlog int) (syscall.Errno, error)

func (*Socket) LogValue

func (s *Socket) LogValue() slog.Value

func (*Socket) PeerAddr

func (s *Socket) PeerAddr() (netip.AddrPort, syscall.Errno, error)

Jump to

Keyboard shortcuts

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