udp

package
v0.17.7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(network string, addr *net.UDPAddr) (net.Listener, error)

func ListenWithPolicies

func ListenWithPolicies(network string, addr *net.UDPAddr, newConnPolicy NewConnPolicy, expirationPolicy ConnExpirationPolicy) (net.Listener, error)

Types

type ConnExpirationPolicy

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

func NewDefaultExpirationPolicy

func NewDefaultExpirationPolicy() ConnExpirationPolicy

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 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
}

Jump to

Keyboard shortcuts

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