let peer behind SymmetricRandom NAT use 70 sockets; punch 1000 holes on the other side

This commit is contained in:
Christian Ulrich 2020-11-21 23:00:15 +01:00
parent d92e8be393
commit bf9569098f
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ type
minPort*: uint16 minPort*: uint16
maxPort*: uint16 maxPort*: uint16
const RandomPortCount = 3000'u16 const RandomPortCount = 1000'u16
proc min(a, b: uint16): uint16 = proc min(a, b: uint16): uint16 =
min(a.int32, b.int32).uint16 min(a.int32, b.int32).uint16

View File

@ -393,7 +393,7 @@ proc main() =
var ctx: QuicP2PContext var ctx: QuicP2PContext
var socks = newSeq[AsyncSocket]() var socks = newSeq[AsyncSocket]()
randomize() randomize()
for i in 0 .. 29: for i in 0 .. 70:
# FIXME: close socks # FIXME: close socks
let sock = newAsyncSocket(sockType = SOCK_DGRAM, protocol = IPPROTO_UDP, let sock = newAsyncSocket(sockType = SOCK_DGRAM, protocol = IPPROTO_UDP,
buffered = false) buffered = false)