I'm working on a web socket wrapper around Binance's web socket stream. System.IO.Pipelines looks interesting to me because of the problems it solves.
I'm most likely going to take one of the following implementations:
- SignalR
- BotBuilder (not sure what exactly that project is)
- DotNet.Interactive.PowerShell
- a project that probably got inspired by Microsoft's implementation
I'm unable to understand what the difference between IDuplexPipe
and Pipe
is.
The IDuplexPipe is a contract for types that support both reading and writing. For example, a network connection would be represented by an IDuplexPipe.
Since the web socket wrapper I'm working on is related to Binance's web socket stream, I assume I need the IDuplexPipe
?
SignalR uses IDuplexPipe
and DotNet.Interactive.PowerShell uses onl the Pipe
class. Can you enlighten of what the difference between these two is with real life example, because I don't really understand what Microsoft's documentation states.
IDuplexPipe documentation:
An IDuplexPipe is an interface that represent something you can Read from, using the PipeReader, and Write to, using the PipeWriter.
The IO.Pipelines Pipe is simply a buffer.
It's explained in the docs you linked: https://learn.microsoft.com/en-us/dotnet/standard/io/pipelines#pipe