net

package
v2.0.0-...-8205865 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 2 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

This section is empty.

Functions

func PacketConnFromConn

func PacketConnFromConn(conn net.Conn) net.PacketConn

PacketConnFromConn converts a net.Conn into a net.PacketConn.

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.

func PacketListenerFromListener

func PacketListenerFromListener(l net.Listener) PacketListener

PacketListenerFromListener converts a net.Listener into a dtlsnet.PacketListener.

Jump to

Keyboard shortcuts

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