Avoid first chance exceptions with one-way pipes over MultiplexingStream
AArnott opened this issue · 0 comments
AArnott commented
From @sharwell:
LinkToAsync could do a better job of handling one-way pipes passed as arguments. Currently it ends up calling LinkToAsync on a completed PipeReader and relies on exception handling to deal with it internally. This results in two first chance exceptions for every PipeWriter passed as an argument.
channelOptions.ExistingPipe.Input might be already completed there, which throws once here:
and once here:
it's at least possible to detect CompletedPipeReader