udp

package
v1.9.13-cui.7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort() (int, error)

GetFreePort returns a free UDP port that can be used for listening

func IsPortAvailable

func IsPortAvailable(port int) bool

IsPortAvailable checks if a UDP port is available for binding

Types

type UDPServer

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

func NewUDPServer

func NewUDPServer() (*UDPServer, error)

func (*UDPServer) Addr

func (s *UDPServer) Addr() string

func (*UDPServer) Close

func (s *UDPServer) Close() error

func (*UDPServer) Port

func (s *UDPServer) Port() int

func (*UDPServer) ReadFrom

func (s *UDPServer) ReadFrom(buffer []byte) (int, *net.UDPAddr, error)

func (*UDPServer) WriteTo

func (s *UDPServer) WriteTo(data []byte, addr *net.UDPAddr) (int, error)

Jump to

Keyboard shortcuts

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