udp

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package udp implements helper structures for working with UDP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

Listener is a struct that implements net.Listener interface for working with UDP. This is achieved by maintaining an internal "nat-like" table with destinations.

func Listen

func Listen(network, addr string) (l *Listener, err error)

Listen creates a new *Listener and is supposed to be a function similar to net.Listen, but for UDP only.

func (*Listener) Accept

func (l *Listener) Accept() (conn net.Conn, err error)

Accept implements the net.Listener interface for *Listener.

func (*Listener) Addr

func (l *Listener) Addr() (addr net.Addr)

Addr implements the net.Listener interface for *Listener.

func (*Listener) Close

func (l *Listener) Close() (err error)

Close implements the net.Listener interface for *Listener.

Jump to

Keyboard shortcuts

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