forked from quic-go/quic-go
The way this is implemented here is not particularly nice, but will improve in the future once we implement spurious RTO decection #687 (where we'll need a packetHistory similar to Chrome's). In particular, we don't consider non-retransmittable packets for RTT measurements or for early retransmit. While that might impact performance in some edge cases, it shouldn't be worse than before :) Fixes #505.
32 lines
909 B
Go
32 lines
909 B
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 may modify the packet
|
|
SentPacket(packet *Packet) error
|
|
ReceivedAck(ackFrame *frames.AckFrame, withPacketNumber protocol.PacketNumber, recvTime time.Time) error
|
|
|
|
SendingAllowed() bool
|
|
GetStopWaitingFrame(force bool) *frames.StopWaitingFrame
|
|
DequeuePacketForRetransmission() (packet *Packet)
|
|
GetLeastUnacked() protocol.PacketNumber
|
|
|
|
GetAlarmTimeout() time.Time
|
|
OnAlarm()
|
|
}
|
|
|
|
// ReceivedPacketHandler handles ACKs needed to send for incoming packets
|
|
type ReceivedPacketHandler interface {
|
|
ReceivedPacket(packetNumber protocol.PacketNumber, shouldInstigateAck bool) error
|
|
ReceivedStopWaiting(*frames.StopWaitingFrame) error
|
|
|
|
GetAckFrame() *frames.AckFrame
|
|
}
|