net

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.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 Transport

type Transport interface {
	modules.ActiveModule

	// Start starts the networking module by initializing and starting the corresponding network services.
	Start() error

	// Stop closes all open connections to other nodes and stops the network services.
	Stop()

	// Send sends msg to the node with ID dest.
	Send(dest t.NodeID, msg *messagepb.Message) error

	// Connect initiates the establishing of network connections to the provided nodes.
	// When Connect returns, the connections might not yet have been established though (see WaitFor).
	Connect(nodes map[t.NodeID]t.NodeAddress)

	// WaitFor waits until at least n connections (including the potentially virtual connection to self)
	// have been established and returns.
	// TODO: Redefine this method to also return when the Transport stops. Add an error return value to indicate this.
	WaitFor(n int)

	// CloseOldConnections closes connections to the nodes that don't needed.
	CloseOldConnections(newNodes map[t.NodeID]t.NodeAddress)
}

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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