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 reactor::Command;
pub use reactor::Event;
pub use reactor::Handle;
pub use reactor::Reactor;
pub use crossbeam_channel;

Modules§

connector
reactor

Structs§

Config
Configuration parameters for the reactor.
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.
TcpStream
A non-blocking TCP stream between a local socket and a remote socket.

Enums§

DecodeError
Possible reasons why a message could not be decoded at a particular time.

Traits§

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