xgress_udp

package
v0.17.90 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	Handle(listener Listener)
}

type Listener

type Listener interface {
	io.Closer
	WriteTo(data []byte, addr net.Addr) (int, error)
	GetSession(sessionId string) (Session, bool)
	DeleteSession(sessionId string)
	QueueEvent(event EventHandler)
	LogContext() string
}

type PacketAddress

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

func Parse

func Parse(s string) (*PacketAddress, error)

func (*PacketAddress) Address

func (pa *PacketAddress) Address() string

func (*PacketAddress) Network

func (pa *PacketAddress) Network() string

func (*PacketAddress) String

func (pa *PacketAddress) String() string

type PacketData

type PacketData struct {
	Buffer []byte
	Source net.Addr
}

func NewPacketData

func NewPacketData(buffer []byte, source net.Addr) *PacketData

type PacketSession

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

func (*PacketSession) Address

func (s *PacketSession) Address() net.Addr

func (*PacketSession) Close

func (s *PacketSession) Close() error

func (*PacketSession) HandleControlMsg added in v0.16.114

func (s *PacketSession) HandleControlMsg(controlType xgress.ControlType, headers channel.Headers, responder xgress.ControlReceiver) error

func (*PacketSession) LogContext

func (s *PacketSession) LogContext() string

func (*PacketSession) MarkActivity

func (s *PacketSession) MarkActivity()

func (*PacketSession) QueueRead

func (s *PacketSession) QueueRead(data []byte)

func (*PacketSession) ReadPayload

func (s *PacketSession) ReadPayload() ([]byte, map[uint8][]byte, error)

func (*PacketSession) SessionId

func (s *PacketSession) SessionId() string

func (*PacketSession) SetState

func (s *PacketSession) SetState(state SessionState)

func (*PacketSession) State

func (s *PacketSession) State() SessionState

func (*PacketSession) TimeoutNanos

func (s *PacketSession) TimeoutNanos() int64

func (*PacketSession) Write

func (s *PacketSession) Write(p []byte) (n int, err error)

func (*PacketSession) WritePayload

func (s *PacketSession) WritePayload(p []byte, _ map[uint8][]byte) (n int, err error)

type Session

type Session interface {
	xgress.Connection
	State() SessionState
	SetState(state SessionState)
	Address() net.Addr
	Write(data []byte) (n int, err error)
	QueueRead(data []byte)
	TimeoutNanos() int64
	MarkActivity()
	SessionId() string
}

func NewPacketSesssion

func NewPacketSesssion(l Listener, addr net.Addr, timeout int64) Session

type SessionState

type SessionState uint8
const (
	SessionStateNew SessionState = iota
	SessionStateEstablished
)

type SessionUpdateEvent

type SessionUpdateEvent PacketSession

func (*SessionUpdateEvent) Handle

func (s *SessionUpdateEvent) Handle(_ Listener)

Jump to

Keyboard shortcuts

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