Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 }
Click to show internal directories.
Click to hide internal directories.