use predicted port range
This commit is contained in:
parent
9e96dd5c78
commit
a191de4452
|
@ -1,5 +1,6 @@
|
|||
import asyncdispatch, asyncnet, strformat
|
||||
from net import IpAddress, Port, `$`, `==`
|
||||
import port_prediction
|
||||
import puncher
|
||||
import utils
|
||||
|
||||
|
@ -39,7 +40,8 @@ proc respond*(puncher: TcpNutssResponder, srcPort: Port, dstIp: IpAddress,
|
|||
let localIp = getPrimaryIPAddr(dstIp)
|
||||
try:
|
||||
let connectFuture = newFuture[AsyncSocket]("respond")
|
||||
for dstPort in dstPorts:
|
||||
let portRange = predictPortRange(dstPorts)
|
||||
for dstPort in portRange:
|
||||
asyncCheck connect(localIp, srcPort, dstIp, dstPort, connectFuture)
|
||||
await connectFuture or sleepAsync(Timeout)
|
||||
if connectFuture.finished():
|
||||
|
|
Loading…
Reference in New Issue