udp

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 9 Imported by: ? 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

Index

Constants

View Source
const DefaultUDPPort = 53

DefaultUDPPort is the well-known port for generic UDP probes.

View Source
const ProtocolName = "udp"

ProtocolName is the registered name for the UDP transport.

Variables

This section is empty.

Functions

This section is empty.

Types

type UDP

type UDP struct{}

UDP implements greet.TransportLayer for UDP probes. Because UDP is connectionless, Dial sends an empty datagram and waits for any response to capture RTT. The returned conn is the live UDPConn; since no app layers run over UDP today the engine closes it immediately after Dial.

func New added in v1.0.3

func New() *UDP

New creates a new UDP transport layer.

func (*UDP) DefaultPort

func (u *UDP) DefaultPort() int

func (*UDP) Dial added in v1.0.3

func (u *UDP) Dial(ctx context.Context, start time.Time, host string, port int) (net.Conn, time.Duration, time.Duration, error)

Dial resolves host, sends an empty datagram, waits for a response, and returns the UDPConn together with TTDR and RTT. RTT is the send→receive round trip. The caller is responsible for closing the returned conn.

func (*UDP) Name

func (u *UDP) Name() string

func (*UDP) Transport

func (u *UDP) Transport() greet.Transport

Jump to

Keyboard shortcuts

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