Documentation ¶
Index ¶
- func Listen(ctx context.Context, address string) (net.Listener, error)
- func ListenWithGROOptimization(ctx context.Context, address string) (net.Listener, error)
- func NewTimeoutConn(raw net.Conn, timeout time.Duration) net.Conn
- func StripTimeoutConn(conn net.Conn) net.Conn
- type TimeoutConn
- func (c *TimeoutConn) ConsumeBuffer(ba *bufferio.BufferArray) error
- func (c *TimeoutConn) GetExtensionProperty() map[string]uint64
- func (c *TimeoutConn) ProduceBuffer(ba *bufferio.BufferArray, offset int) error
- func (c *TimeoutConn) Read(buf []byte) (int, error)
- func (c *TimeoutConn) SupportBufferIO() bool
- func (c *TimeoutConn) SupportKeepAlive() bool
- func (c *TimeoutConn) Write(buf []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
Listen creates a listener for UDP "connections" on `laddr`. Note: application layer should have idle detection logic.
func ListenWithGROOptimization ¶
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.
Types ¶
type TimeoutConn ¶
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)
Click to show internal directories.
Click to hide internal directories.