Closed serzhiio closed 1 year ago
It's worth to say i try to read stream immediately after it opened and not waiting for read
event.
This is currently expected behavior. We queue Readable
events when processing a packet, and multiple packets may be processed in series. This can lead to an Opened
event being immediately followed by Readable
events, or even multiple Readable
events. If you read the stream in full after the first Opened
or Readable
event, you will see UnknownStream
on any future access to that stream, as might be prompted by the following already-queued events.
You could handle UnknownStream
errors by skipping the event, or do what the quinn
crate does and consume all stream events in one go in a way that combines duplicates (e.g. setting a flag in your application-layer stream state) before attempting to manipulate a stream in response.
I can't get it, why there is
read event
andunknown stream
Err on.recv_stream(stream_id)
on a stream already finalized after previous read. (I use one stream per message)