forked from quic-go/quic-go
docs: improve documentation of OptimizeConn (#3910)
This commit is contained in:
@@ -25,12 +25,16 @@ var _ OOBCapablePacketConn = &net.UDPConn{}
|
||||
|
||||
// OptimizeConn takes a net.PacketConn and attempts to enable various optimizations that will improve QUIC performance:
|
||||
// 1. It enables the Don't Fragment (DF) bit on the IP header.
|
||||
// This allows us to do DPLPMTUD (Path MTU Discovery).
|
||||
// This is required to run DPLPMTUD (Path MTU Discovery, RFC 8899).
|
||||
// 2. It enables reading of the ECN bits from the IP header.
|
||||
// This allows the remote node to speed up its loss detection and recovery.
|
||||
// 3. It uses batched syscalls (recvmmsg) to more efficiently receive packets from the socket.
|
||||
// 4. It uses Generic Segmentation Offload (GSO) to efficiently send batches of packets (on Linux).
|
||||
//
|
||||
// For this to work, the connection needs to implement the OOBCapablePacketConn interface (as a *net.UDPConn does).
|
||||
// In order for this to work, the connection needs to implement the OOBCapablePacketConn interface (as a *net.UDPConn does).
|
||||
//
|
||||
// It's only necessary to call this function explicitly if the application calls WriteTo
|
||||
// after passing the connection to the Transport.
|
||||
func OptimizeConn(c net.PacketConn) (net.PacketConn, error) {
|
||||
return wrapConn(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user