udp

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 13 Imported by: 1 module, 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 udp implements UDP listeners as net.Listeners: every client, identified by its address, gets a conn of its own.

Index

Constants

This section is empty.

Variables

View Source
var DefaultListenConfig = ListenConfig{}

DefaultListenConfig is the config the dataplane listens with.

Functions

This section is empty.

Types

type ListenConfig

type ListenConfig struct {
	// Net is the network to listen on, nil for the OS network.
	Net transport.Net
	// ConnectBack connects a socket back to every client so the kernel demuxes; it needs
	// reuse-port, so only the OS network can do it.
	ConnectBack bool
	// Admit, if set, decides on the first datagram of a source whether it gets a conn; the
	// datagrams of a source it refuses are dropped.
	Admit func(src net.Addr) bool
}

ListenConfig configures a UDP listener.

func (ListenConfig) Listen

func (lc ListenConfig) Listen(network, address string) (net.Listener, error)

Listen binds a UDP listener at address.

Jump to

Keyboard shortcuts

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