2021-08-03 09:04:02 +00:00
|
|
|
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"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler
|
|
|
|
func NewAckHandler(
|
|
|
|
initialPacketNumber protocol.PacketNumber,
|
2021-08-27 11:26:00 +00:00
|
|
|
initialMaxDatagramSize protocol.ByteCount,
|
2021-08-03 09:04:02 +00:00
|
|
|
rttStats *utils.RTTStats,
|
|
|
|
pers protocol.Perspective,
|
|
|
|
tracer logging.ConnectionTracer,
|
|
|
|
logger utils.Logger,
|
|
|
|
version protocol.VersionNumber,
|
|
|
|
) (SentPacketHandler, ReceivedPacketHandler) {
|
2021-08-27 11:26:00 +00:00
|
|
|
sph := newSentPacketHandler(initialPacketNumber, initialMaxDatagramSize, rttStats, pers, tracer, logger)
|
2021-08-03 09:04:02 +00:00
|
|
|
return sph, newReceivedPacketHandler(sph, rttStats, logger, version)
|
|
|
|
}
|