transport

package
v0.0.0-...-1d9596f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePacket

func ParsePacket(buf []byte) (*pb.Packet, error)

Types

type UDPListener

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

UDPListener handles reading packets from the underlying UDP connection.

func ListenUDP

func ListenUDP(addr string) (*UDPListener, error)

ListenUDP sets up a UDP server that receives packets containing events.

func (*UDPListener) Close

func (u *UDPListener) Close() error

func (*UDPListener) LocalAddr

func (u *UDPListener) LocalAddr() net.Addr

func (*UDPListener) Next

func (u *UDPListener) Next() (payload []byte, source *net.UDPAddr, err error)

Next returns the next packet from UDP and it's associated source address. Should an error occur, then it is returned. A source address may be returned alongside an error for further reporting in the event of abuse/debugging.

Jump to

Keyboard shortcuts

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