fix: succesfull echo example completed

This commit is contained in:
Akash Mondal
2025-07-01 12:24:57 +00:00
committed by lla-dane
parent 8f0cdc9ed4
commit 6c45862fe9
8 changed files with 199 additions and 83 deletions

View File

@ -55,7 +55,7 @@ async def run_server(port: int, seed: int | None = None) -> None:
# QUIC transport configuration
quic_config = QUICTransportConfig(
idle_timeout=30.0,
max_concurrent_streams=1000,
max_concurrent_streams=100,
connection_timeout=10.0,
enable_draft29=False,
)
@ -68,16 +68,21 @@ async def run_server(port: int, seed: int | None = None) -> None:
# Server mode: start listener
async with host.run(listen_addrs=[listen_addr]):
print(f"I am {host.get_id().to_string()}")
host.set_stream_handler(PROTOCOL_ID, _echo_stream_handler)
try:
print(f"I am {host.get_id().to_string()}")
host.set_stream_handler(PROTOCOL_ID, _echo_stream_handler)
print(
"Run this from the same folder in another console:\n\n"
f"python3 ./examples/echo/echo_quic.py "
f"-d {host.get_addrs()[0]}\n"
)
print("Waiting for incoming QUIC connections...")
await trio.sleep_forever()
print(
"Run this from the same folder in another console:\n\n"
f"python3 ./examples/echo/echo_quic.py "
f"-d {host.get_addrs()[0]}\n"
)
print("Waiting for incoming QUIC connections...")
await trio.sleep_forever()
except KeyboardInterrupt:
print("Closing server gracefully...")
await host.close()
return
async def run_client(destination: str, seed: int | None = None) -> None:
@ -96,7 +101,7 @@ async def run_client(destination: str, seed: int | None = None) -> None:
# QUIC transport configuration
quic_config = QUICTransportConfig(
idle_timeout=30.0,
max_concurrent_streams=1000,
max_concurrent_streams=100,
connection_timeout=10.0,
enable_draft29=False,
)