github.com/tumi8/quic-go@v0.37.4-tum/noninternal/congestion/interface.go (about)

     1  package congestion
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/tumi8/quic-go/noninternal/protocol"
     7  )
     8  
     9  // A SendAlgorithm performs congestion control
    10  type SendAlgorithm interface {
    11  	TimeUntilSend(bytesInFlight protocol.ByteCount) time.Time
    12  	HasPacingBudget(now time.Time) bool
    13  	OnPacketSent(sentTime time.Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool)
    14  	CanSend(bytesInFlight protocol.ByteCount) bool
    15  	MaybeExitSlowStart()
    16  	OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime time.Time)
    17  	OnPacketLost(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount)
    18  	OnRetransmissionTimeout(packetsRetransmitted bool)
    19  	SetMaxDatagramSize(protocol.ByteCount)
    20  }
    21  
    22  // A SendAlgorithmWithDebugInfos is a SendAlgorithm that exposes some debug infos
    23  type SendAlgorithmWithDebugInfos interface {
    24  	SendAlgorithm
    25  	InSlowStart() bool
    26  	InRecovery() bool
    27  	GetCongestionWindow() protocol.ByteCount
    28  }