socket

package
v0.0.0-...-d3d7005 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotBind        = errors.New("socket not bind")
	ErrAlreadyBind    = errors.New("socket already bind")
	ErrNotListen      = errors.New("socket not listen")
	ErrAlreadyListen  = errors.New("socket already listen")
	ErrNotConnect     = errors.New("socket not connect")
	ErrAlreadyConnect = errors.New("socket already connect")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Connect(addr string) error
}

type Conn

type Conn interface {
	filesystem.ControlFile
	Read(b []byte) (n int, err error)
	Write(b []byte) (n int, err error)
}

type Network

type Network = string
const (
	TCP        Network = "tcp"
	TCP4       Network = "tcp4"
	TCP6       Network = "tcp6"
	UDP        Network = "udp"
	UDP4       Network = "udp4"
	UDP6       Network = "udp6"
	IP         Network = "ip"
	IP4        Network = "ip4"
	IP6        Network = "ip6"
	Unix       Network = "unix"
	UnixGram   Network = "unixgram"
	UnixPacket Network = "unixpacket"
)

type Server

type Server interface {
	Bind(addr string) error
	Listen() error
	Accept() (Conn, error)
}

type Socket

type Socket interface {
	Server
	Client
	Conn
}

func New

func New(network Network) Socket

Jump to

Keyboard shortcuts

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