fix infinite loop

This commit is contained in:
Christian Ulrich 2020-11-14 14:33:00 +01:00
parent ed125417cb
commit 278f066797
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 1 deletions

View File

@ -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")