fix: succesfull echo

This commit is contained in:
Akash Mondal
2025-06-30 12:58:11 +00:00
committed by lla-dane
parent bbe632bd85
commit 8f0cdc9ed4
5 changed files with 26 additions and 19 deletions

View File

@ -125,12 +125,12 @@ async def run_client(destination: str, seed: int | None = None) -> None:
msg = b"hi, there!\n"
await stream.write(msg)
# Notify the other side about EOF
await stream.close()
response = await stream.read()
print(f"Sent: {msg.decode('utf-8')}")
print(f"Got: {response.decode('utf-8')}")
await stream.close()
await host.disconnect(info.peer_id)
async def run(port: int, destination: str, seed: int | None = None) -> None: