mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
The RTTStats are used by the logging package. In order to instrument the congestion package, the RTTStats can't be part of that package any more (to avoid an import loop).
22 lines
774 B
Go
22 lines
774 B
Go
package ackhandler
|
|
|
|
import (
|
|
"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 *utils.RTTStats,
|
|
pers protocol.Perspective,
|
|
traceCallback func(quictrace.Event),
|
|
tracer logging.ConnectionTracer,
|
|
logger utils.Logger,
|
|
version protocol.VersionNumber,
|
|
) (SentPacketHandler, ReceivedPacketHandler) {
|
|
sph := newSentPacketHandler(initialPacketNumber, rttStats, pers, traceCallback, tracer, logger)
|
|
return sph, newReceivedPacketHandler(sph, rttStats, logger, version)
|
|
}
|