move congestion control from session to ackhandler

this simplifies things a bit, especially in prep for #56
This commit is contained in:
Lucas Clemente
2016-05-18 19:35:31 +02:00
parent 7a97f34fac
commit a0228a9049
6 changed files with 202 additions and 261 deletions

View File

@@ -1,8 +1,6 @@
package ackhandler
import (
"time"
"github.com/lucas-clemente/quic-go/frames"
"github.com/lucas-clemente/quic-go/protocol"
)
@@ -10,13 +8,15 @@ import (
// SentPacketHandler handles ACKs received for outgoing packets
type SentPacketHandler interface {
SentPacket(packet *Packet) error
ReceivedAck(ackFrame *frames.AckFrame) (time.Duration, []*Packet, []*Packet, error)
ReceivedAck(ackFrame *frames.AckFrame) error
HasPacketForRetransmission() bool
DequeuePacketForRetransmission() (packet *Packet)
BytesInFlight() protocol.ByteCount
GetLargestObserved() protocol.PacketNumber
AllowsSending() bool
}
// ReceivedPacketHandler handles ACKs needed to send for incoming packets