Is there a function/helper/class to connect two streams together? #825
-
I have two streams that I've setup in some way, did some handshake, whatever. Now I would like to connect them. What comes from a stream should go to the other and the same on the other way. If a stream errors or gets closed, the other should do that too. Is there a built-in way to do this? I know that I can do it myself, but I don't know if I'm handling all the edge cases or errors, so I was hoping to have something built-in. I mean, it's basically what an HTTP proxy is doing. Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Nerdbank.Streams doesn't have anything for this IIRC, because it's trivial to do with existing APIs in .NET: Task connectedTask = Task.WhenAll(one.CopyToAsync(other), other.CopyToAsync(one)); |
Beta Was this translation helpful? Give feedback.
Nerdbank.Streams doesn't have anything for this IIRC, because it's trivial to do with existing APIs in .NET: