mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package ackhandler
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/lucas-clemente/quic-go/frames"
|
|
"github.com/lucas-clemente/quic-go/protocol"
|
|
)
|
|
|
|
// SentPacketHandler handles ACKs received for outgoing packets
|
|
type SentPacketHandler interface {
|
|
SentPacket(packet *Packet) error
|
|
ReceivedAck(ackFrame *frames.AckFrame) (time.Duration, []*Packet, []*Packet, error)
|
|
|
|
DequeuePacketForRetransmission() (packet *Packet)
|
|
|
|
BytesInFlight() protocol.ByteCount
|
|
GetLargestObserved() protocol.PacketNumber
|
|
}
|
|
|
|
// ReceivedPacketHandler handles ACKs needed to send for incoming packets
|
|
type ReceivedPacketHandler interface {
|
|
ReceivedPacket(packetNumber protocol.PacketNumber, entropyBit bool) error
|
|
ReceivedStopWaiting(*frames.StopWaitingFrame) error
|
|
|
|
DequeueAckFrame() (*frames.AckFrame, error)
|
|
}
|
|
|
|
// StopWaitingManager manages StopWaitings for sent packets
|
|
type StopWaitingManager interface {
|
|
RegisterPacketForRetransmission(packet *Packet)
|
|
GetStopWaitingFrame() *frames.StopWaitingFrame
|
|
SentStopWaitingWithPacket(packetNumber protocol.PacketNumber)
|
|
ReceivedAckForPacketNumber(packetNumber protocol.PacketNumber)
|
|
}
|