summaryrefslogtreecommitdiffstats
path: root/poc/spike5_client.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-19 17:58:05 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-19 17:58:05 +0200
commit1ec316035ce9aa656dd18a05889856bce9e3aba3 (patch)
treeb50e97f50d485ef2a88ce36fe4d7511d9fe3e288 /poc/spike5_client.py
parent171a3e175889ce30f201fcdf5c4632f480344ae6 (diff)
parent95dd3dc13aecec85c2fd72410cd4d1f4ed582dfa (diff)
downloadmeshbay-1ec316035ce9aa656dd18a05889856bce9e3aba3.tar.gz
Merge origin/main: the tree-wide ruff pass beside the Music reconnect work
Diffstat (limited to 'poc/spike5_client.py')
-rw-r--r--poc/spike5_client.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/poc/spike5_client.py b/poc/spike5_client.py
index 11b3ac0..cc79ebf 100644
--- a/poc/spike5_client.py
+++ b/poc/spike5_client.py
@@ -12,16 +12,23 @@ Acts as the "file requester":
- Reports timing and results
"""
-import asyncio, json, base64, struct, time, sys
+import asyncio
+import base64
+import json
+import struct
+import sys
+import time
+
+import blake3
+from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
-from cryptography.hazmat.primitives import hashes
-import blake3
PORT = 19003
CHUNK_INDEX = 0
-PASS = "✓"; FAIL = "✗"
+PASS = "✓"
+FAIL = "✗"
# ── Wire helpers ───────────────────────────────────────────────────────────────
@@ -115,7 +122,7 @@ async def handle_node(reader, writer):
total_ms = recv_ms + verify_ms
print(f"\n {'='*50}")
- print(f" Timings:")
+ print(" Timings:")
print(f" Network receive : {recv_ms:.0f} ms")
print(f" Verify+decrypt : {verify_ms:.1f} ms")
print(f" Total : {total_ms:.0f} ms")
@@ -133,7 +140,7 @@ async def main():
async with server:
try:
await asyncio.wait_for(server.serve_forever(), timeout=30)
- except asyncio.TimeoutError:
+ except TimeoutError:
print(f" {FAIL} Timeout — node did not connect within 30s")
sys.exit(1)