2017-05-27 22:30:11 +03:00
|
|
|
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 {
|
2017-07-28 01:11:56 +03:00
|
|
|
// SentPacket may modify the packet
|
2017-05-27 22:30:11 +03:00
|
|
|
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
|
2017-08-23 19:32:08 +03:00
|
|
|
SetLowerLimit(protocol.PacketNumber)
|
2017-05-27 22:30:11 +03:00
|
|
|
|
2017-07-28 01:11:56 +03:00
|
|
|
GetAlarmTimeout() time.Time
|
2017-05-27 22:30:11 +03:00
|
|
|
GetAckFrame() *frames.AckFrame
|
|
|
|
}
|