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.
Types ¶
This section is empty.