close sockets in example app
This commit is contained in:
parent
83c0fb0fc8
commit
4cf608459f
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue