Crate peerlink

Crate peerlink 

Source
Expand description

§Peer-to-peer networking reactor

Peerlink is a low-level building block for P2P applications. It uses a nonblocking reactor to accept inbound connections, make outbound connections, do message streaming and reassembly, track peers and perform other low-level operations. It entirely abstracts away menial networking plumbing such as managing TCP sockets and reading bytes off the wire. In other words, it provides the consumer with a simple interface to talking with other nodes in a P2P network.

See the included example for usage.

Re-exports§

pub use crossbeam_channel;

Modules§

connector

Structs§

Config
Configuration parameters for the reactor.
Handle
Provides bidirectional communication with a reactor. If this is dropped the reactor stops.
PeerId
Unique peer identifier. These are unique for the lifetime of the process and strictly incrementing for each new connection. Even if the same peer (in terms of socket address) connects multiple times, a new PeerId instance will be issued for each connection.
StreamConfig
Stream related configuration parameters.

Enums§

Command
Command variants for the reactor to process.
DecodeError
Possible reasons why a message could not be decoded at a particular time.
DisconnectReason
Explains why a client connection was disconnected.
Event

Traits§

Message
A trait that network messages processed by the reactor must implement.

Functions§

run
Runs a new reactor using some config and the default connector.
run_with_connector
Runs a new reactor using custom settings and a custom reactor.