common

package
v0.0.0-...-6daa40f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pacer

type Pacer struct {
	// contains filtered or unexported fields
}

Pacer implements a token bucket pacing algorithm.

func NewPacer

func NewPacer(getBandwidth func() congestion.ByteCount) *Pacer

func (*Pacer) Budget

func (p *Pacer) Budget(now time.Time) congestion.ByteCount

func (*Pacer) SentPacket

func (p *Pacer) SentPacket(sendTime time.Time, size congestion.ByteCount)

func (*Pacer) SetMaxDatagramSize

func (p *Pacer) SetMaxDatagramSize(s congestion.ByteCount)

func (*Pacer) TimeUntilSend

func (p *Pacer) TimeUntilSend() time.Time

TimeUntilSend returns when the next packet should be sent. It returns the zero value of time.Time if a packet can be sent immediately.

Jump to

Keyboard shortcuts

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