udp

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ctx context.Context, address string) (net.Listener, error)

Listen creates a listener for UDP "connections" on `laddr`. Note: application layer should have idle detection logic.

func ListenWithGROOptimization

func ListenWithGROOptimization(ctx context.Context, address string) (net.Listener, error)

ListenWithGROOptimization tries to listen UDP with GRO optimization enabled.

Note: Application layer should have idle detection logic. Note: GRO optimization is for Linux only, it will merge small packets into a larger one so application layer should be able to handle packets with incorrect sizes.

func NewTimeoutConn

func NewTimeoutConn(raw net.Conn, timeout time.Duration) net.Conn

func StripTimeoutConn

func StripTimeoutConn(conn net.Conn) net.Conn

Types

type TimeoutConn

type TimeoutConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*TimeoutConn) ConsumeBuffer

func (c *TimeoutConn) ConsumeBuffer(ba *bufferio.BufferArray) error

func (*TimeoutConn) GetExtensionProperty

func (c *TimeoutConn) GetExtensionProperty() map[string]uint64

func (*TimeoutConn) ProduceBuffer

func (c *TimeoutConn) ProduceBuffer(ba *bufferio.BufferArray, offset int) error

func (*TimeoutConn) Read

func (c *TimeoutConn) Read(buf []byte) (int, error)

func (*TimeoutConn) SupportBufferIO

func (c *TimeoutConn) SupportBufferIO() bool

func (*TimeoutConn) SupportKeepAlive

func (c *TimeoutConn) SupportKeepAlive() bool

func (*TimeoutConn) Write

func (c *TimeoutConn) Write(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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