quinn
quinn copied to clipboard
Provide example code for quinn-proto
quinn-proto is difficult to use, and one of the reasons is that there is no example code provided outside of its own test cases.
What are you trying to do? As we haven't had many people interested in using quinn-proto, it would be interesting to hear more about your use case and what kind of documentation you'd need.
Probably the best way to figure out the quinn-proto API is by looking at the code in quinn, for now.
I am trying to use quinn-proto in libp2p. My current efforts can be found here. It successfully establishes a connection, but fails to open any streams.
Okay, and do you have any particular issues that you're running into/things you need example code for? I usually find it easier to start from concrete questions or problems. Do you get an error when opening a stream, or does the connection hang?
The connection hangs. The side opening a connection succeeds, but the other side never gets the StreamOpened event.
If I have the side that opened the stream write to it first, the connection succeeds. It is only when the responder sends the first data that the stream hangs.
I'm pretty sure that stream opening, by itself, does not notify the peer. So you have to send something when opening the stream to let the peer know that the stream is now active. Would that explain the hang you're seeing?
@djc Yes, it would. Is sending an empty string sufficient?
There are only bytes. You'd have to send at least one byte, I guess.
Darn. That is a problem for protocols in which the server sends the first packet, such as SSH.
Why is that a problem? Either peer can open streams whenever it likes.