Documentation
¶
Index ¶
Constants ¶
View Source
const MaxBatchSize = 64
MaxBatchSize is the maximum number of packets that can be read/written in a single batch.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchPacketConn ¶
type BatchPacketConn interface {
net.PacketConn
ReadBatch(msgs []Message, flags int) (int, error)
WriteBatch(msgs []Message, flags int) (int, error)
}
BatchPacketConn is a PacketConn with batched I/O using Messages.
func New ¶
func New(network string, pc net.PacketConn) (BatchPacketConn, error)
New creates a pooled BatchPacketConn wrapping a UDP PacketConn. network must be one of: "udp", "udp4", "udp6" (empty treated as "udp"). If network == "udp", we infer from LocalAddr(); if ambiguous we prefer IPv6. Only *net.UDPConn is supported.
Click to show internal directories.
Click to hide internal directories.