networkmonitor

package
v0.0.0-...-0cdedd5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STABLE   = NetworkConditionType(1)
	UNSTABLE = NetworkConditionType(0)
)

Variables

View Source
var (
	ErrPacketTooLate   = errors.New("packetbuffers: packet is too late")
	ErrPacketDuplicate = errors.New("packetbuffers: packet is duplicate")
)

Functions

This section is empty.

Types

type NetworkConditionType

type NetworkConditionType int

type NetworkMonitor

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

func Default

func Default() *NetworkMonitor

func New

func New(maxLatency time.Duration, stableDuration time.Duration) *NetworkMonitor

func (*NetworkMonitor) Add

func (n *NetworkMonitor) Add(seq uint16) error

func (*NetworkMonitor) OnNetworkConditionChanged

func (n *NetworkMonitor) OnNetworkConditionChanged(f func(condition NetworkConditionType))

Jump to

Keyboard shortcuts

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