From 4cf608459f84e7be4a4c69d42f415d5b18b7d635 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Wed, 7 Oct 2020 09:42:40 +0200 Subject: [PATCH] close sockets in example app --- examples/app/app.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/app/app.nim b/examples/app/app.nim index 41f8f24..3183cbf 100644 --- a/examples/app/app.nim +++ b/examples/app/app.nim @@ -232,6 +232,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string, let msg = await sock.recv(4) echo "received message: ", msg await sock.send("pong") + sock.close() else: # initiate a new connection @@ -243,6 +244,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string, await sock.send("ping") let msg = await sock.recv(4) echo "received message: ", msg + sock.close() proc main() = if paramCount() < 3 or paramCount() > 4: