udp_vconn

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnExpirationPolicy

type ConnExpirationPolicy interface {
	IsExpired(now, lastUsed time.Time) bool
	PollFrequency() time.Duration
}

func NewDefaultExpirationPolicy

func NewDefaultExpirationPolicy() ConnExpirationPolicy

type Event

type Event interface {
	Handle(Manager) error
}

type Manager

type Manager interface {
	GetWriteQueue(clientAddr net.Addr) WriteQueue
	CreateWriteQueue(targetAddr *net.UDPAddr, clientAddr net.Addr, service *entities.Service, conn UDPWriterTo) (WriteQueue, error)
	QueueEvent(Event)
	QueueError(error)
}

func NewManager

func NewManager(provider tunnel.FabricProvider, newConnPolicy NewConnPolicy, expirationPolicy ConnExpirationPolicy) Manager

type NewConnAcceptResult

type NewConnAcceptResult int
const (
	Allow NewConnAcceptResult = iota
	Deny
	AllowDropLRU
)

type NewConnPolicy

type NewConnPolicy interface {
	NewConnection(currentCount uint32) NewConnAcceptResult
}

func NewLimitedConnectionPolicyDropLRU

func NewLimitedConnectionPolicyDropLRU(limit uint32) NewConnPolicy

func NewLimitedConnectionPolicyDropNew

func NewLimitedConnectionPolicyDropNew(limit uint32) NewConnPolicy

func NewUnlimitedConnectionPolicy

func NewUnlimitedConnectionPolicy() NewConnPolicy

type UDPWriterTo

type UDPWriterTo interface {
	io.Closer
	WriteTo(b []byte, addr net.Addr) (int, error)
	LocalAddr() net.Addr
}

type UnpooledBuffer

type UnpooledBuffer []byte

func (UnpooledBuffer) GetPayload

func (u UnpooledBuffer) GetPayload() []byte

func (UnpooledBuffer) Release

func (u UnpooledBuffer) Release()

type WriteQueue

type WriteQueue interface {
	Accept(mempool.PooledBuffer)
	LocalAddr() net.Addr
	Service() string
}

Jump to

Keyboard shortcuts

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