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.
Release files for sp2ppy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sp2ppy-1.0.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sp2ppy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / sp2ppy-1.0.0.tar.gz
| Download URL | sp2ppy-1.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed48cf15932ddeeefd04028d06237456acbf68b29799d7aab65c7118f3864c52
|
|
BLAKE2b-256 checksum How to use checksums |
6202ded9baf4b50fd5c0c287922ff4cece2a92b750b9f7ff4de8a5f2c77af8a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / sp2ppy-1.0.0-py3-none-any.whl
| Download URL | sp2ppy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b1381f7f900b8a01e50ae217d8eb2429d700b5a4a8966c7011910693a917f49
|
|
BLAKE2b-256 checksum How to use checksums |
50a87193b9e92bbdc89fc3acd45a4e2613971bae57308169fe490b0186acc22f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|