Closed rom1v closed 2 years ago
Refer to the documentation:
Streams are cheap and instantaneous to open unless blocked by flow control. As a consequence, the peer won’t be notified that a stream has been opened until the stream is actually used.
If you want the peer to see something, send something. If you have nothing to send, that's an indication that maybe the peer should be the one opening the stream.
OK, thank you for your answer :+1:
Hi,
I'm fairly new in QUIC, so I have a question regarding a behavior I observe with quinn.
When a "server" awaits for the creation of a new stream (either uni or bi), the creation is not signaled until the other peer actually writes data:
Here is what I observe:
I'd like the server to be notified "immediately" (without waiting for the client to write actual data to the stream) of stream creation, i.e. I'd like
new_conn.uni_streams.try_next().await
to return as soon as the stream is created.Here are the main parts of the sample.
The server listens on port 1234, accepts the connection, then awaits for a uni stream to be created:
The client connects to the server, immediately open a uni stream, awaits 5 seconds, then write to the stream:
The full sample project is available here: quinn-example.
Is it the expected behavior? Is it configurable, or does the QUIC protocol forbid to signal stream creation until data is written?