udp

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListener

func NewListener(conn net.PacketConn, cfg *ListenConfig) net.Listener

Types

type ListenConfig

type ListenConfig struct {
	Addr           net.Addr
	Backlog        int
	ReadQueueSize  int
	ReadBufferSize int
	TTL            time.Duration
	Keepalive      bool
	Logger         logger.Logger
}

type ReadUDP

type ReadUDP interface {
	ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
	ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error)
}

type Relay

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

func NewRelay

func NewRelay(pc1, pc2 net.PacketConn) *Relay

func (*Relay) Run

func (r *Relay) Run(ctx context.Context) (err error)

func (*Relay) SetBufferSize

func (r *Relay) SetBufferSize(n int)

func (*Relay) WithBypass

func (r *Relay) WithBypass(bp bypass.Bypass) *Relay

func (*Relay) WithLogger

func (r *Relay) WithLogger(logger logger.Logger) *Relay

type WriteUDP

type WriteUDP interface {
	WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
	WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error)
}

Jump to

Keyboard shortcuts

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