Closed bltavares closed 4 years ago
I am able to receive send Want
and receive Have
but I can't seem to be able to receive Data
requests.
It looks like the protocol.loop_next()
is responsible to receive and send data on the channel. The way it is running now it handle messages in batches, and I'm using a error budget count to ensure that all messages have been handled by the channels.
That is less then ideal. It seems to be ideal instead to spawn a background task that loops on top of the loop_next
to keep using channels in the main stream thread. I have no idea how I will make that a single stream then :/
Clones a metadata and content feeds from a hypercore-daemon peer given a hash and ip:port
https://gist.github.com/bltavares/f37af663cb6f9fb4bd30ccabb1453a2a
I can already have some bytes getting exchanged, but it needs to finalize the protocol exchange to get the first bytes and intialize the content as expected