github.com/sagernet/quic-go@v0.43.1-beta.1/internal/ackhandler/ackhandler.go (about) 1 package ackhandler 2 3 import ( 4 "github.com/sagernet/quic-go/internal/protocol" 5 "github.com/sagernet/quic-go/internal/utils" 6 "github.com/sagernet/quic-go/logging" 7 ) 8 9 // NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler. 10 // clientAddressValidated indicates whether the address was validated beforehand by an address validation token. 11 // clientAddressValidated has no effect for a client. 12 func NewAckHandler( 13 initialPacketNumber protocol.PacketNumber, 14 initialMaxDatagramSize protocol.ByteCount, 15 rttStats *utils.RTTStats, 16 clientAddressValidated bool, 17 enableECN bool, 18 pers protocol.Perspective, 19 tracer *logging.ConnectionTracer, 20 logger utils.Logger, 21 ) (SentPacketHandler, ReceivedPacketHandler) { 22 sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, clientAddressValidated, enableECN, pers, tracer, logger) 23 return sph, newReceivedPacketHandler(sph, logger) 24 }