channelmonitor

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0, MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Max time to wait for other side to accept open channel request before attempting restart
	AcceptTimeout time.Duration
	// Interval between checks of transfer rate
	Interval time.Duration
	// Min bytes that must be sent / received in interval
	MinBytesTransferred uint64
	// Number of times to check transfer rate per interval
	ChecksPerInterval uint32
	// Backoff after restarting
	RestartBackoff time.Duration
	// Number of times to try to restart before failing
	MaxConsecutiveRestarts uint32
	// Max time to wait for the responder to send a Complete message once all
	// data has been sent
	CompleteTimeout time.Duration
}

type Monitor

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

Monitor watches the data-rate for data transfer channels, and restarts a channel if the data-rate falls too low or if there are timeouts / errors

func NewMonitor

func NewMonitor(mgr monitorAPI, cfg *Config) *Monitor

func (*Monitor) AddPullChannel

func (m *Monitor) AddPullChannel(chid datatransfer.ChannelID) monitoredChan

AddPullChannel adds a pull channel to the channel monitor

func (*Monitor) AddPushChannel

func (m *Monitor) AddPushChannel(chid datatransfer.ChannelID) monitoredChan

AddPushChannel adds a push channel to the channel monitor

func (*Monitor) Shutdown

func (m *Monitor) Shutdown()

func (*Monitor) Start

func (m *Monitor) Start()

Jump to

Keyboard shortcuts

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