udpcheck

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package udpcheck sends bounded, tagged UDP delivery probes.

Index

Constants

View Source
const (
	MaxPorts = 8
	MaxCount = 300
	MaxPPS   = 50
	MinSize  = 64
	MaxSize  = 1200
)

Variables

View Source
var (
	ErrBadParams       = errors.New("udpcheck: bad parameters")
	ErrUnsupportedHost = errors.New("udpcheck: unsupported destination")
	ErrNoRoute         = errors.New("udpcheck: no route")
)

Functions

func Resolve

func Resolve(ctx context.Context, host string) (netip.Addr, error)

Resolve resolves a node address to one IP, preferring IPv4. Its behavior matches the health probe resolver.

func Send

func Send(ctx context.Context, host string, ports []uint16, tag [8]byte, count, pps, size int) (family string, sent int, err error)

Send emits count datagrams per port, one to every port per tick. sent is the number of complete ticks delivered to every port. The payload is generated once and reused, with tag as its first eight bytes.

func Validate

func Validate(host string, ports []uint16, count, pps, size int) error

Validate checks the same hard limits Send enforces before opening sockets.

Types

This section is empty.

Jump to

Keyboard shortcuts

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