ProtocolReader.ReadAsync doesn't advance if read is successful
See original GitHub issueThe AdvanceTo
is only invoked when read fails; most protocols will involve multiple messages, but the second call to ReadAsync
reliably fails with:
Unhandled exception. System.InvalidOperationException: Advance must be called before calling ReadAsync
Repro is here
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Reading binary data in c# / ReadAsync not ...
1 Answer 1 · what I was wondering is if the program could hit this condition if it is reading a file locally,...
Read more >CCS/RM48L952: TI Fee Read Async Operation Question
When I perform a readback via TI_Fee_Read on the newly written block, the reading doesn't contain valid data samples although taking a look ......
Read more >Stream.ReadAsync Method (System.IO)
Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read....
Read more >Pipe Dreams, part 2 - Marc Gravell
When the read is complete, it commits that-many bytes to the pipe using Advance , then it invokes FlushAsync() on the pipe to...
Read more >BufferedStream.ReadAsync Method (System.IO)
Asynchronously reads a sequence of bytes from the current buffered stream and advances the position within the buffered stream by the number of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On the API design: I think I’m in favor of the explicit
Advance
. This ties in well with allowing me to do a zero-copy parse that just deframes segments of the original buffer. Then we can callAdvance
once the deframed data has been processed. So: nothing to see here!@davidfowl the state machine evaporates if we https://github.com/dotnet/runtime/issues/13633