INVALID_ID error in accept after long connection
gabbhack opened this issue · comments
Gabben commented
import sequtils
import chronos
import stew/byteutils
import libp2p
import libp2p/protocols/rendezvous
import libp2p/discovery/rendezvousinterface
import libp2p/discovery/discoverymngr
import i2ptransport
proc createSwitch(samAddress: TransportAddress, i2pSettings: I2PSettings, rdv: RendezVous = RendezVous.new()): Switch =
SwitchBuilder.new()
.withRng(newRng())
.withTransport(proc(upgr: Upgrade): Transport = I2PTransport.new(samAddress, i2pSettings, upgrade=upgr))
.withYamux()
.withNoise()
.withRendezVous(rdv)
.build()
proc main() {.async, gcsafe.} =
let
rdv = RendezVous.new()
samAddress = initTAddress("127.0.0.1:7656")
i2pSettings = I2PSettings.init("nickname")
bootNode = createSwitch(samAddress, i2pSettings, rdv)
await bootNode.start()
while true:
await sleepAsync(10.seconds)
waitFor(main())
I think the reason is that the control socket was closed by a timeout.