uquic/internal/ackhandler/ackhandler.go

23 lines
828 B
Go

package ackhandler
import (
"github.com/lucas-clemente/quic-go/internal/congestion"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/logging"
"github.com/lucas-clemente/quic-go/quictrace"
)
// NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler
func NewAckHandler(
initialPacketNumber protocol.PacketNumber,
rttStats *congestion.RTTStats,
pers protocol.Perspective,
traceCallback func(quictrace.Event),
qlogger logging.Tracer,
logger utils.Logger,
version protocol.VersionNumber,
) (SentPacketHandler, ReceivedPacketHandler) {
sph := newSentPacketHandler(initialPacketNumber, rttStats, pers, traceCallback, qlogger, logger)
return sph, newReceivedPacketHandler(sph, rttStats, logger, version)
}