close socket on timeout
This commit is contained in:
parent
383260c95e
commit
699f8306c2
|
@ -79,7 +79,7 @@ method initiate*(puncher: TcpNutssPuncher, attempt: Attempt,
|
|||
try:
|
||||
let acceptFuture = attempt.acceptFuture.get()
|
||||
await injectSynPackets(attempt)
|
||||
await progress("")
|
||||
await progress("") # FIXME: await means we wait until the rendezvous server replied
|
||||
await acceptFuture or sleepAsync(Timeout)
|
||||
if acceptFuture.finished():
|
||||
result = acceptFuture.read()
|
||||
|
|
1
udp.nim
1
udp.nim
|
@ -41,6 +41,7 @@ proc doInitiate(srcIp: IpAddress, srcPort: Port, dstIp: IpAddress,
|
|||
await sock.send("ACK")
|
||||
initiateFuture.complete(sock)
|
||||
else:
|
||||
sock.close()
|
||||
echo &"connection {srcIp}:{srcPort.int} -> {dstIp}:{dstPort.int} timed out"
|
||||
|
||||
proc doRespond(srcIp: IpAddress, srcPort: Port, dstIp: IpAddress,
|
||||
|
|
Loading…
Reference in New Issue