From ee2f95b72f6afcf1c823b6588dabf2074aa68e74 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sun, 23 Aug 2020 14:48:43 +0200 Subject: [PATCH] try other direction --- examples/app/app.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/app/app.nim b/examples/app/app.nim index 4276e54..a6b5271 100644 --- a/examples/app/app.nim +++ b/examples/app/app.nim @@ -227,9 +227,9 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string, if not hasSock: break echo "accepted!" + await sock.send("ping") let msg = await sock.recv(1000) echo "received message: ", msg - await sock.send("pong") else: # initiate a new connection @@ -238,9 +238,9 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string, asyncCheck handleServerMessages(serverConn) let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId) echo "connected!" - await sock.send("ping") let msg = await sock.recv(1000) echo "received message: ", msg + await sock.send("pong") proc main() = if paramCount() < 3 or paramCount() > 4: