Server isolation and detailed errors

Isolated the JsonServer to server.py inside protocols/json

Added specific errors for server startup timeout and server startup
failed

Refactored errors for Core to CoreError generic and refactored
StateError to CoreStateMismatchError derived from CoreError
This commit is contained in:
h3cx committed 2026-08-03 17:17:33 +01:00
1 parent 321ccb178e
commit 482c093f38
11 files changed
+418 -65

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import asyncio
async def main() -> None:
reader, writer = await asyncio.open_connection(
host="127.0.0.1",
port=8765,
)
print("Connected")
try:
await asyncio.sleep(10)
finally:
writer.close()
await writer.wait_closed()
print("Disconnected")
asyncio.run(main())