API Proposal PipeReader ReadAsync could take an expected size #2220
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.IO.Pipelines
Milestone
Because the flow is inverted with pipelines there is less understanding at the lower levels of the expected data. Often the application protocols have an idea (or if no the application protocol at least the intermediate ones).
For instance in Tls if I only get a partial frame, I know the size of the rest of the frame. Rather than having to loop over and over on ReadAsync() if I haven't got enough yet it would be good to be able to call
var result = await ReadAsync(expectedSize : 40)
and it not return until the connection closes/dies/or there are enough bytes to fill that amount.
The text was updated successfully, but these errors were encountered: