udp_session

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUdpSessionFullCone

func NewUdpSessionFullCone(ctx context.Context, src net.Destination,
	cancelCause context.CancelCauseFunc, responseWriter responseWriter,
	requestChan chan *udp.Packet) *udpSessionFullCone

func NewUdpSessionSymetric

func NewUdpSessionSymetric(ctx context.Context, src net.Destination,
	dst net.Destination, cancelCause context.CancelCauseFunc,
	responseWriter responseWriter, pipe *pipe.Pipe) *udpSessionSymetric

Types

type SessionManager

type SessionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *SessionManager

func (*SessionManager) AddUdpSession

func (u *SessionManager) AddUdpSession(src net.Destination, s UdpSession)

func (*SessionManager) Close

func (u *SessionManager) Close()

func (*SessionManager) CloseAndRemoveUdpSession

func (u *SessionManager) CloseAndRemoveUdpSession(src net.Destination)

func (*SessionManager) GetUdpSession

func (u *SessionManager) GetUdpSession(src net.Destination) (s UdpSession, found bool)

func (*SessionManager) Start

func (u *SessionManager) Start()

type UDPSessionCommon

type UDPSessionCommon struct {
	Ctx         context.Context
	Src         net.Destination
	CancelCause context.CancelCauseFunc
	Ipv4        bool
	Time        time.Time
	CloseOnce   sync.Once
}

func (*UDPSessionCommon) HasTimeout

func (u *UDPSessionCommon) HasTimeout() bool

type UdpSession

type UdpSession interface {
	Ctx() context.Context
	Src() net.Destination
	// return quickly
	// Send p to its destination
	Dispatch(p *udp.Packet) error
	// close all related resources
	Close()
}

Jump to

Keyboard shortcuts

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