Support setting NamedPipeClientStream.ReadMode with PipeAccessRights ctor overload#100001
Merged
jeffhandley merged 7 commits intodotnet:mainfrom Mar 27, 2024
Merged
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #83072 (Cannot set ReadMode after creating a NamedPipeClientStream instance).
Per the API Review notes and video:
NamedPipeClientStreamthat acceptsPipeAccessRightsPipeAccessRightsfrom System.IO.Pipes.AccessRights to System.IO.Pipes, and add the necessary type-forwardThe .NET Framework implementation was referenced from Pipe.cs, but the behavior was improved slightly.
directionargument is given a valid value when thedesiredAccessRightsvalue is invalid, ensuring that the correctdesiredAccessRightsargument exception is throwndesiredAccessRightsvalue missing both theReadData(1) andWriteData(2) bits would throw an argument exception fordirection, which is not an argument to the constructordesiredAccessRightsalso throws for a0value, which netfx didn't doThe functionality was tested using the following server / client apps:
server.cs
client.cs
With this PR, that application works as expected, with the client detecting completed messages after each word and rendering newlines.