ndtm

package
v0.0.0-...-39125e7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Receiver

func Receiver(ctx context.Context, conn *websocket.Conn, connInfo *results.ConnectionInfo, mchannel chan<- results.Measurement) error

Receiver receives data over the provided websocket.Conn.

Measurements are read at semi-random intervals and sent over mchannel.

The context drives how long the connection lasts. If the context is canceled or there is an error, the connection and the rates channel are closed.

func Sender

func Sender(ctx context.Context, conn *websocket.Conn, connInfo *results.ConnectionInfo,
	mchannel chan<- results.Measurement) error

Sender sends ndt-m data over the provided websocket.Conn and spawns a goroutine to process incoming counterflow messages.

Measurements are sent to the mchannel channel. You SHOULD pass to this function a channel with a reasonably large buffer (e.g., 64 slots) because the emitter will not block on sending.

The context drives how long the connection lasts. If the context is canceled or there is an error, the connection and the measurement channel are closed.

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)

Upgrade upgrades the HTTP connection to WebSockets. Returns the upgraded websocket.Conn.

Types

This section is empty.

Directories

Path Synopsis
Package spec contains constants for the ndt-m protocol.
Package spec contains constants for the ndt-m protocol.

Jump to

Keyboard shortcuts

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