With System.IO.Pipelines
you can read and parse data from a socket either by:
- Creating a
Pipe
and filling it with aPipeWriter
Task that directly receives from a socket withSocket.ReceiveAsync()
and using anotherPipeReader
Task to parse the data from the pipe.
OR
- Use a
PipeReader
Task directly on theNetworkStream
from the socket to parse the data directly from the stream withPipeReader.Create(new NetworkStream(Socket)))
Is one way more performant than the other, or is the performance difference negligible?