fix infinite loop
This commit is contained in:
parent
ed125417cb
commit
278f066797
|
@ -182,12 +182,12 @@ proc getEndpoint(srcPort: Port, serverHostname: string, serverPort: Port):
|
||||||
while true:
|
while true:
|
||||||
try:
|
try:
|
||||||
sock.bindAddr(srcPort)
|
sock.bindAddr(srcPort)
|
||||||
|
break
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if failCount == 3:
|
if failCount == 3:
|
||||||
raise e
|
raise e
|
||||||
failCount.inc
|
failCount.inc
|
||||||
await sleepAsync(100)
|
await sleepAsync(100)
|
||||||
continue
|
|
||||||
await sock.connect(serverHostname, serverPort)
|
await sock.connect(serverHostname, serverPort)
|
||||||
let id = rand(uint32)
|
let id = rand(uint32)
|
||||||
await sock.send(&"get-endpoint|{id}\n")
|
await sock.send(&"get-endpoint|{id}\n")
|
||||||
|
|
Loading…
Reference in New Issue