You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above overload of StreamReader.ReadAsync() cannot be canceled with cancellationToken even if the underlying stream supports cancellation because it does not propagate cancellationToken to the underlying stream
At first glance this looks like a simple oversight of not adding a CancellationToken parameter to StreamReader.ReadBufferAsync() (patch included in the zip). I suspect there may be a reason, though.
The above overload of
StreamReader.ReadAsync()
cannot be canceled withcancellationToken
even if the underlying stream supports cancellation because it does not propagatecancellationToken
to the underlying streamActual Behavior
StreamReader.ReadAsync()
indefinitely blocks.Excpected Behavior
OperationCanceledException
is thrown.Environment
Repro
The code below prints
0 chars read
instead ofcanceled
. See StreamReaderCancellation.zip for the full code.The text was updated successfully, but these errors were encountered: