Crates.io | pea2pea |
lib.rs | pea2pea |
version | 0.50.0 |
source | src |
created_at | 2020-12-23 07:48:30.712312 |
updated_at | 2024-07-05 08:53:03.087514 |
description | A simple, low-level, and customizable implementation of a TCP P2P node. |
homepage | |
repository | https://github.com/ljedrz/pea2pea |
max_upload_size | |
id | 326425 |
size | 454,657 |
pea2pea is a simple, low-level, and customizable implementation of a TCP P2P node.
The core library only provides the most basic functionalities like starting, ending and maintaining connections; the rest is up to a few low-level, opt-in protocols:
Handshake
requires connections to adhere to the given handshake logic before anything else can be done with themReading
enables the node to receive messages based on the user-supplied DecoderWriting
enables the node to send messages based on the user-supplied EncoderOnDisconnect
makes the node perform specified actions whenever a connection with a peer is severedOnConnect
makes the node perform specified actions whenever a connection with a peer is fully established (post-handshake)unsafe
code, there's more code in tests
than in the actual libraryNode
and any extra state you'd like to carry alongside itPea2Pea
trait for itThat's it!
1.0