Multiple responses for one request, and their order
Hello, I am setting up a data forwarding network using litep2p. May I ask a question about the RequestResponse protocol behavior.
Does the RequestResponse protocol support sending multiple responses from the response side for one request? If so, will these responses be received in sequence by the requesting side?
The connection closed after sending one response.
Fortunately, according to the libp2p specification (https://docs.libp2p.io/concepts/fundamentals/protocols/#binary-streams), the data is read in the same order as it was written. (I believe litep2p's transport follows it. 😉)
A customized protocol can be achieved by referring to the custom_protocol example and the implementation of RequestResponseProtocol.
Yes, request-response protocol only allows sending one response per request. Basically, a new substream is opened for every request and closed after receiving the response.