Documentation
¶
Index ¶
Constants ¶
const MaxBatchSize = 64
MaxBatchSize is the maximum number of packets that can be read/written in a single batch.
const MaxDatagramSize = 9216
MaxDatagramSize bounds a single receive buffer for tunnel underlay sockets. Every tunnel datagram fits in the fixed api.TunnelPathMTU (1500); 9216 gives jumbo-frame headroom on top rather than paying for the 64KiB UDP theoretical max — buffers at this size are held per batch slot for the whole lifetime of a blocked read, per session, so the difference is most of the datapath's steady-state heap. A larger datagram is truncated by the kernel and dropped by decap/QUIC parsing, which is already the fate of anything above path MTU.
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.