netudp

package
v0.0.0-...-b1c78d7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUDP

func IsUDP(network string) bool

func NewUDPSocket

func NewUDPSocket(network, addr string, reusePort bool) (int, unix.Sockaddr, error)

Types

type Mmsg

type Mmsg struct {
	Addr *net.UDPAddr
	Data []byte
}

type ReaderWriter

type ReaderWriter struct {
	// contains filtered or unexported fields
}

func NewRW

func NewRW(fd, n, mtu int) *ReaderWriter

func (*ReaderWriter) ReadFrom

func (rw *ReaderWriter) ReadFrom(readFunc func([]byte, *net.UDPAddr, error))

func (*ReaderWriter) WriteTo

func (rw *ReaderWriter) WriteTo(data []byte, addr *net.UDPAddr) error

func (*ReaderWriter) WriteToN

func (rw *ReaderWriter) WriteToN(mmsgs ...*Mmsg) (int, error)

See: https://man7.org/linux/man-pages/man2/sendmmsg.2.html

Jump to

Keyboard shortcuts

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