uquic/ackhandler/interfaces.go
2016-05-12 17:43:48 +07:00

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)
}