sshnet / SSH.NET

SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.
MIT License
3.87k stars 915 forks source link

Fix a few issues with PipeStream #1399

Closed Rob-Hague closed 3 weeks ago

Rob-Hague commented 1 month ago

Apply similar treatment to PipeStream as #1322 did to ShellStream

PipeStream now behaves much more Stream-like. In particular, it performs partial reads (instead of blocking until a certain amount of data is available), blocks until data is available (instead of returning 0 prematurely) and removes the Stream-unlike properties BlockLastReadBuffer and MaxBufferLength.

Sadly I gave up trying to make a benchmark compatible with all the quirks of the previous implementation, but a dumb throughput test (reading and writing simultaneously) shows about 5.2GB/s with this implementation compared to 140MB/s previously.

Some cleanup of its usage in the library followed.

contributes to #650 (does not make any of the suggested source breaking changes - still worth considering) closes #440 closes #164 closes #12 closes #1045 closes #142

of existing PRs: closes #1070 closes #924 closes #374 closes #13

Rob-Hague commented 3 weeks ago

Thank you

vladd commented 3 weeks ago

Thank you for fixing all these problems! Is there any estimation, in which release is the fix going to be included?

Rob-Hague commented 3 weeks ago

I have a couple more fixes/changes I'd like to make to SshCommand before the next release, and then we can make one then. So I would say June, but the last time I answered that question I said May and it won't be May :-)