udp

package
v1.1.32 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(addrAndPort string, buffer []byte) error

Broadcast broadcasts an udp datagram

Types

type UDPBroadcaster

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

UDPBroadcaster allow to boradcast and receive broadcasted udp datagrams

func NewUDPBroadcaster

func NewUDPBroadcaster(port int) (*UDPBroadcaster, error)

func (*UDPBroadcaster) Broadcast

func (ub *UDPBroadcaster) Broadcast(databram []byte) error

func (*UDPBroadcaster) Close

func (ub *UDPBroadcaster) Close()

func (*UDPBroadcaster) Read

func (ub *UDPBroadcaster) Read(timeout time.Duration) (*UDPDatagram, error)

type UDPDatagram

type UDPDatagram struct {
	Payload []byte
	Addr    net.Addr
}

Jump to

Keyboard shortcuts

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