net

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package net defines packet-oriented primitives that are compatible with net in the standard library.

Index

Constants

This section is empty.

Variables

View Source
var PacketBufferRingbufferSize = 0 //nolint:gochecknoglobals

PacketBufferRingbufferSize allows for setting the ring buffer size. A size of 0 (default), means the ring buffer will grow when full. If a size if provided, the packets will be dropped when the ring buffer is full.

Functions

This section is empty.

Types

type PacketListener

type PacketListener interface {
	// Accept waits for and returns the next connection to the listener.
	Accept() (net.PacketConn, net.Addr, error)

	// Close closes the listener.
	// Any blocked Accept operations will be unblocked and return errors.
	Close() error

	// Addr returns the listener's network address.
	Addr() net.Addr
}

A PacketListener is the same as net.Listener but returns a net.PacketConn on Accept() rather than a net.Conn.

Multiple goroutines may invoke methods on a PacketListener simultaneously.

Jump to

Keyboard shortcuts

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