Skip to content

API Proposal PipeReader ReadAsync could take an expected size #2220

@Drawaes

Description

@Drawaes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions