socket

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AF_INET  = unix.AF_INET
	AF_INET6 = unix.AF_INET6

	SOCK_DGRAM = unix.SOCK_DGRAM
	SOCK_RAW   = unix.SOCK_RAW

	IPPROTO_UDP    = unix.IPPROTO_UDP
	IPPROTO_ICMP   = unix.IPPROTO_ICMP
	IPPROTO_ICMPV6 = unix.IPPROTO_ICMPV6

	SOL_SOCKET        = unix.SOL_SOCKET
	SO_RCVTIMEO       = unix.SO_RCVTIMEO
	IPPROTO_IP        = unix.IPPROTO_IP
	IPPROTO_IPV6      = unix.IPPROTO_IPV6
	IP_TTL            = unix.IP_TTL
	IPV6_UNICAST_HOPS = unix.IPV6_UNICAST_HOPS
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

type Socket interface {
	Close() error
	Port() (port int, err error)
	SetSockOptTimeval(level, opt int, tv *time.Duration) error
	SetSockOptInt(level, opt, value int) error
	SendTo(data []byte, flags, port int, addr net.IP) error
	RecvFrom(buf []byte, flags int) (n int, fromAddr net.IP, err error)
	Bind(port int, addr net.IP) error
}

Socket is an abstraction over raw UDP & ICMP sockets (IPv4 & IPv6)

func NewSocket

func NewSocket(family, typ, proto int) (Socket, error)

Jump to

Keyboard shortcuts

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