Revert "use SO_REUSEADDR in accept loop"
This reverts commit b0398adc12
.
This commit is contained in:
parent
b0398adc12
commit
1b315f0eee
|
@ -239,7 +239,7 @@ proc runApp(serverHostname: string, serverPort: Port, peerId: string,
|
||||||
srcPort)
|
srcPort)
|
||||||
asyncCheck handleServerMessages(serverConn)
|
asyncCheck handleServerMessages(serverConn)
|
||||||
let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId,
|
let sock = await punchHole(punchdConn, serverConn, peerId, otherPeerId,
|
||||||
"tcp-syni")
|
"tcp-nutss")
|
||||||
echo "connected!"
|
echo "connected!"
|
||||||
await sock.send("ping")
|
await sock.send("ping")
|
||||||
let msg = await sock.recv(4)
|
let msg = await sock.recv(4)
|
||||||
|
|
|
@ -48,7 +48,6 @@ proc acceptConnections(punchd: Punchd, ip: IpAddress, port: Port,
|
||||||
else:
|
else:
|
||||||
assert(false, "can only accept TCP or UDP connections")
|
assert(false, "can only accept TCP or UDP connections")
|
||||||
let sock = newAsyncSocket(sockType = sockType, protocol = protocol)
|
let sock = newAsyncSocket(sockType = sockType, protocol = protocol)
|
||||||
sock.setSockOpt(OptReuseAddr, true)
|
|
||||||
sock.bindAddr(port, $ip)
|
sock.bindAddr(port, $ip)
|
||||||
sock.listen()
|
sock.listen()
|
||||||
while true:
|
while true:
|
||||||
|
|
Loading…
Reference in New Issue