nettype

package
v0.0.0-...-ded95ce Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package nettype defines an interface that doesn't exist in the Go net package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PacketConn

type PacketConn interface {
	net.PacketConn
	WriteToUDPAddrPort([]byte, netip.AddrPort) (int, error)
}

type PacketListener

type PacketListener interface {
	ListenPacket(ctx context.Context, network, address string) (net.PacketConn, error)
}

PacketListener defines the ListenPacket method as implemented by net.ListenConfig, net.ListenPacket, and tstest/natlab.

type PacketListenerWithNetIP

type PacketListenerWithNetIP interface {
	ListenPacket(ctx context.Context, network, address string) (PacketConn, error)
}

func MakePacketListenerWithNetIP

func MakePacketListenerWithNetIP(ln PacketListener) PacketListenerWithNetIP

type Std

type Std struct{}

Std implements PacketListener using the Go net package's ListenPacket func.

func (Std) ListenPacket

func (Std) ListenPacket(ctx context.Context, network, address string) (net.PacketConn, error)

Jump to

Keyboard shortcuts

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