Closed finnonly closed 4 months ago
Currently the main pipe for creating connections and the additional pipes for the connections themselves use the same method, so this is not possible for the main client (but will most likely work with SingleConnection versions of clients)
I added PipeServer.CreatePipeStreamForConnectionFunc
in latest release now, please try to set up this for CreatePipeStreamForConnectionFunc and test
PipeServer.CreatePipeStreamForConnectionFunc No effect
PipeConnection has a reading thread. If it is set to write only, ReadAsync will prompt that reading is not supported.
I created test for WriteOnly server case and disabled reading thread if PipeStream does not have Read capabilities. It should be released soon in 2.1.0.
Looking forward to the release of the new version.😊
Unfortunately, I'm running macOS and it worked correctly, but the Windows tests failed with an exception and I'm trying to fix it:
Test method H.Pipes.Tests.Tests.WriteOnlyServer threw exception:
System.AggregateException: One or more errors occurred. (Access to the path is denied.) ---> System.UnauthorizedAccessException: Access to the path is denied.
Stack Trace:
at System.IO.Pipes.NamedPipeClientStream.TryConnect(Int32 timeout, CancellationToken cancellationToken)
at System.IO.Pipes.NamedPipeClientStream.ConnectInternal(Int32 timeout, CancellationToken cancellationToken, Int32 startTime)
Hi, have you found your problem? I tried to set PipeDirection.In on the server, but it was still PipeDirection.InOut on the client. I got the same error as you. PipeDirection.In and PipeDirection.Out need to be connected one-to-one so that there will be no
Unfortunately stuck with this. I will release a new prerelease version with the ability to set CreatePipeStreamForConnectionFunc for the client, you can help if you check different options
I roughly looked at the PipeConnection code, and there is a start method. If the NamedPipeClientStream is in the write-only state, I think PipeConnection.ReadWorker does not need to be run.
I think this is already being processed, maybe I should move it outside of the ReadWorker, but I was afraid of breaking something
After testing the 2.1.0-dev322 version, it seems that it can only read and write. Close this issue.
CreatePipeStreamFunc = (pipeName) => new NamedPipeServerStream(pipeName, PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.WriteThrough);
When customizing a NamedPipeServerStream, the client connects and prompts that reading the stream is not supported.