From 278f066797bdbed4ebd2a79a7bff989eeec70dbc Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sat, 14 Nov 2020 14:33:00 +0100 Subject: [PATCH] fix infinite loop --- examples/app/app.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/app/app.nim b/examples/app/app.nim index 9027664..67db242 100644 --- a/examples/app/app.nim +++ b/examples/app/app.nim @@ -182,12 +182,12 @@ proc getEndpoint(srcPort: Port, serverHostname: string, serverPort: Port): while true: try: sock.bindAddr(srcPort) + break except OSError as e: if failCount == 3: raise e failCount.inc await sleepAsync(100) - continue await sock.connect(serverHostname, serverPort) let id = rand(uint32) await sock.send(&"get-endpoint|{id}\n")