Closed AachoLoya closed 2 years ago
https://learn.microsoft.com/en-us/dotnet/api/system.io.pipelines.pipereader.copytoasync
Asynchronously reads the bytes from the PipeReader and writes them to the specified PipeWriter, using a specified buffer size and cancellation token.
How do I specify Buffer size?
https://github.com/davidfowl/BedrockFramework/blob/main/samples/ServerApplication/EchoServerApplication.cs
This sample is almost 3 years old. Wondering if things have changed now in ASP.NET 7 or can I still use this TCP sample? Is it production ready?
Another concern I have with TCP Echo Server is how to handle "Fast Producer, Slow Consumer" problem. Is there a way to limit buffered data being received from client until client consumes all the data that's being sent back? Example, I'd like to limit it to 32KB pending, if client hasn't read all data being sent back, then server shouldn't read anymore from client.