udp_relay

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENoReady   = errors.New("connection not ready")
	ENoAddress = errors.New("no address could be access")
)

Functions

This section is empty.

Types

type RelayConn

type RelayConn interface {
	net.Conn

	WriteTo([]byte, net.Addr) (int, error)

	String() string
}

func NewWrapConn

func NewWrapConn(conn net.Conn, addrs ...net.Addr) RelayConn

type UDPPacket

type UDPPacket struct {
	Deadline int64

	Address *net.UDPAddr

	Data   [1024]byte
	Length int
	// contains filtered or unexported fields
}

func (*UDPPacket) Reset

func (this *UDPPacket) Reset()

type UDPTransmission

type UDPTransmission struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUDPTransmission

func NewUDPTransmission(t time.Duration, f0 func(*net.UDPAddr) RelayConn, f1 func(*UDPPacket)) *UDPTransmission

func (*UDPTransmission) Forward

func (this *UDPTransmission) Forward(p *UDPPacket) bool

func (*UDPTransmission) GetUDPPacket

func (this *UDPTransmission) GetUDPPacket() *UDPPacket

func (*UDPTransmission) PutUDPPacket

func (this *UDPTransmission) PutUDPPacket(p *UDPPacket)

func (*UDPTransmission) SetErrorHandlerFunc

func (this *UDPTransmission) SetErrorHandlerFunc(fn func(error))

func (*UDPTransmission) String

func (this *UDPTransmission) String() string

Jump to

Keyboard shortcuts

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