Super P2P library
Project description
SP2PPY
API
Server
SP2P (Super Peer-to-Peer) Relay Server
Responsibilities:
- Accepts TCP connections from clients.
- Assigns unique 8-character hex addresses to clients.
- Allows clients to connect to each other via the
CONN <ADDRESS>command. - Relays data between paired clients.
SP2P Protocol:
- On connect:
YOURADDR <ADDRESS>is sent to the client. - To connect to a peer: send
CONN <TARGET_ADDRESS>. - On success: connecting client receives
OK, the target peer receivesCONNED <ADDRESS>. - All relayed messages:
<SENDER_ADDRESS>: <DATA>. - On disconnect initiated by a peer: the other side receives
DISCONN.
Client
SP2P (Super Peer-to-Peer) TCP Client
Responsibilities:
- Connects to an SP2P
Serverand receives its unique address. - Sends
CONN <ADDRESS>to initiate a connection to another peer. - Handles incoming commands and packets:
YOURADDR <ADDR>: own assigned addressOK: connection to peer successfulCONNED <ADDR>: peer has connected to youDISCONN: peer has disconnected<ADDR>: <DATA>: message relayed from peer
Hooks (override in subclass or override instance methods):
- on_ready(address): Called with own address after connecting to server.
- on_connected(): Called after successful connection to peer.
- on_peer_connected(peer_address): Called when a peer connects to you.
- on_disconnected(): Called when the peer disconnects.
- on_message(sender_address, message): Called on incoming message.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sp2ppy-1.0.0.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sp2ppy-1.0.0.tar.gz.
File metadata
- Download URL: sp2ppy-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed48cf15932ddeeefd04028d06237456acbf68b29799d7aab65c7118f3864c52
|
|
| MD5 |
f8311649d7279903d9498e439e55189e
|
|
| BLAKE2b-256 |
6202ded9baf4b50fd5c0c287922ff4cece2a92b750b9f7ff4de8a5f2c77af8a5
|
File details
Details for the file sp2ppy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sp2ppy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b1381f7f900b8a01e50ae217d8eb2429d700b5a4a8966c7011910693a917f49
|
|
| MD5 |
3499a635cc75698aef06d2f77a7055b0
|
|
| BLAKE2b-256 |
50a87193b9e92bbdc89fc3acd45a4e2613971bae57308169fe490b0186acc22f
|