Crate snarkos_node_tcp

Source
Expand description

Tcp is a simple, low-level, and customizable implementation of a TCP stack.

Modules§

connections
Objects associated with connection handling.
protocols
Opt-in protocols available to the node; each protocol is expected to spawn its own task that runs throughout the node’s lifetime and handles a specific functionality. The communication with these tasks is done via dedicated handler objects.

Structs§

BannedPeers
Contains the set of peers currently banned by IP.
Config
The Tcp’s configuration. See the source of Config::default for the defaults.
Connection
Created for each active connection; used by the protocols to obtain a handle for reading and writing, and keeps track of tasks that have been spawned for the connection.
KnownPeers
Contains statistics related to Tcp’s peers, currently connected or not.
Stats
Contains statistics related to Tcp.
Tcp
The central object responsible for handling connections.

Enums§

ConnectionSide
Indicates who was the initiator and who was the responder when the connection was established.

Traits§

P2P
A trait for objects containing a Tcp; it is required to implement protocols.

Functions§

create_span
Creates the Tcp’s tracing span based on its name.
is_bogon_ip
Checks if the given IP address is a bogon address.
is_unspecified_or_broadcast_ip
Checks if the given IP address is unspecified or broadcast.