Questions tagged [system.io.pipelines]

a .Net library that is designed to make it easier to do high performance IO in .NET. Use for questions about implementation of the library classes.

System.IO.Pipelines is a new library that is designed to make it easier to do high performance IO in .NET. The library targets the .NET Standard and works on all .NET implementations.

High Performance IO in .Net - Microsoft

28 questions
1
vote
1 answer

Trying to understand IDuplexPipe

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…
nop
  • 4,711
  • 6
  • 32
  • 93
1
vote
1 answer

Can I use System.IO.Pipelines in synchronous mode?

I'm currently using System.IO.Pipelines to build a client-server application. Once each client starts, it should request the server to provide some configuration so it will know what to do. The current situation is the System.IO.Pipelines works in…
y-me
  • 277
  • 4
  • 13
1
vote
1 answer

ReadOnlySequence conversion from ReadOnlySequence?

I'm trying to use System.IO.Pipelines to parse large text files. But I can't find no conversion function from ReadOnlySequence to ReadOnlySequence. For example like MemoryMarshal.Cast. IMHO it is pretty useless having a generic…
1
vote
1 answer

Operations on ReadOnlySequence

I am doing some experimenting with System.IO.Pipelines and can't work out the best way to convert or use the returned ReadOnlySequence objects. The only way I have been able to do anything with it is to convert it to an array and then do normal byte…
Rowan Smith
  • 1,815
  • 15
  • 29
0
votes
0 answers

Writing C# class objects to a file using pipelines. Unable to implement the read logic

How do I read the file that it is writing? I have the following two issues: I think I need to make it follow a certain protocol e.g. length prefixed, which tells me how much bytes I need to read for each saved C# class object, or perhaps a…
nop
  • 4,711
  • 6
  • 32
  • 93
0
votes
0 answers

System.IO.Pipelines - Stream Protobuf Serialized C# objects into a file and read them in a separate stream

I want to stream C# objects into a file. I need write/read loop. The read loop should be reading continuously from a specific file starting from the beginning. What I mean by "continuously" is when it reaches the end of the file, it shouldn't just…
nop
  • 4,711
  • 6
  • 32
  • 93
0
votes
0 answers

Pipe reader is not getting unblocked

I am using System.IO.Pipelines to read from a web socket and bumped into a problem where PipeReader.ReadAsync is not getting unblocked, with the example code I can clearly see that the full messages are read from the web socket and flushed BUT the…
NullReference
  • 862
  • 1
  • 11
  • 27
0
votes
1 answer

Threadpool Starvation C# Async Socket Clients

I have written an application that connects out to multiple servers (50+ at the moment). The start up of the application is slow. It appears to be due to ThreadPool starvation because after taking different timings and wireshark traces the problem…
uriDium
  • 13,110
  • 20
  • 78
  • 138
0
votes
1 answer

Gracefully closing pipe web sockets

I'm trying to create a pipe web socket client, which is going to pull data off exchanges. The code is something between David Fowler's BedrockFramework and @StephenCleary's TCP Chat. I'm not sure if there is a difference between IDuplexPipe (David's…
nop
  • 4,711
  • 6
  • 32
  • 93
0
votes
1 answer

HTTP echo server using System.IO.Pipelines and Span

I'm messing around trying to learn pipelines in .NET 6.0. What I'm trying to do is simple implementation of HTTP/1.1 server. Nothing fancy, probably wouldn't work for most real-life cases, but that doesn't matter anyway. To make things easy, let's…
0
votes
0 answers

System.IO.Pipelines Socket.ReceiveAsync(Socket, Memory) vs PipeReader.Create(Socket.GetStream())

With System.IO.Pipelines you can read and parse data from a socket either by: Creating a Pipe and filling it with a PipeWriter Task that directly receives from a socket with Socket.ReceiveAsync() and using another PipeReader Task to parse the data…
0
votes
1 answer

PipeWriter and length prefixed messages

I'm trying to write binary message using PipeWriter that is prefixed with byte length. Byte length is unknown to me until whole message is finished. Can this be done at all with PipeWriter? Basically I'm trying to implement those three methods: void…
ghord
  • 13,260
  • 6
  • 44
  • 69
0
votes
1 answer

PipeReader CancelPendingRead not cancelling current read operation

I expected to be able to start another read operation if I cancel the current read with CancelPendingRead. But this code throws a InvalidOperationException. Does CancelPendingRead not work as i think or what could be the problem? I'm testing with…
musium
  • 2,942
  • 3
  • 34
  • 67
1
2