Help us shape the future of Go! Take the 2026 Go Developer Survey

bwe

package
v1.13.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRTT         = float64(0.070) // 70 ms
	RTTSmoothingFactor = float64(0.5)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BWE

type BWE interface {
	Type() BWEType

	SetBWEListener(bweListner BWEListener)

	Reset()

	HandleREMB(
		receivedEstimate int64,
		expectedBandwidthUsage int64,
		sentPackets uint32,
		repeatedNacks uint32,
	)

	// TWCC sequence number
	RecordPacketSendAndGetSequenceNumber(
		atMicro int64,
		size int,
		isRTX bool,
		probeClusterId ccutils.ProbeClusterId,
		isProbe bool,
	) uint16

	HandleTWCCFeedback(report *rtcp.TransportLayerCC)

	UpdateRTT(rtt float64)

	CongestionState() CongestionState

	CanProbe() bool
	ProbeDuration() time.Duration
	ProbeClusterStarting(pci ccutils.ProbeClusterInfo)
	ProbeClusterDone(pci ccutils.ProbeClusterInfo)
	ProbeClusterIsGoalReached() bool
	ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool)
}

type BWEListener

type BWEListener interface {
	OnCongestionStateChange(fromState CongestionState, toState CongestionState, estimatedAvailableChannelCapacity int64)
}

type BWEType added in v1.9.1

type BWEType int
const (
	BWETypeNone BWEType = iota
	BWETypeRemote
	BWETypeSendSide
)

func (BWEType) String added in v1.9.1

func (b BWEType) String() string

type CongestionState

type CongestionState int
const (
	CongestionStateNone CongestionState = iota
	CongestionStateEarlyWarning
	CongestionStateCongested
)

func (CongestionState) String

func (c CongestionState) String() string

type NullBWE

type NullBWE struct {
}

func (*NullBWE) CanProbe

func (n *NullBWE) CanProbe() bool

func (*NullBWE) CongestionState

func (n *NullBWE) CongestionState() CongestionState

func (*NullBWE) HandleREMB

func (n *NullBWE) HandleREMB(
	_receivedEstimate int64,
	_expectedBandwidthUsage int64,
	_sentPackets uint32,
	_repeatedNacks uint32,
)

func (*NullBWE) HandleTWCCFeedback

func (n *NullBWE) HandleTWCCFeedback(_report *rtcp.TransportLayerCC)

func (*NullBWE) ProbeClusterDone

func (n *NullBWE) ProbeClusterDone(_pci ccutils.ProbeClusterInfo)

func (*NullBWE) ProbeClusterFinalize

func (n *NullBWE) ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool)

func (*NullBWE) ProbeClusterIsGoalReached

func (n *NullBWE) ProbeClusterIsGoalReached() bool

func (*NullBWE) ProbeClusterStarting

func (n *NullBWE) ProbeClusterStarting(_pci ccutils.ProbeClusterInfo)

func (*NullBWE) ProbeDuration

func (n *NullBWE) ProbeDuration() time.Duration

func (*NullBWE) RecordPacketSendAndGetSequenceNumber

func (n *NullBWE) RecordPacketSendAndGetSequenceNumber(
	_atMicro int64,
	_size int,
	_isRTX bool,
	_probeClusterId ccutils.ProbeClusterId,
	_isProbe bool,
) uint16

func (*NullBWE) Reset

func (n *NullBWE) Reset()

func (*NullBWE) SetBWEListener

func (n *NullBWE) SetBWEListener(_bweListener BWEListener)

func (*NullBWE) UpdateRTT

func (n *NullBWE) UpdateRTT(rtt float64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL