Support setting NamedPipeClientStream.ReadMode with PipeAccessRights ctor overload#100001
Merged
jeffhandley merged 7 commits intodotnet:mainfrom Mar 27, 2024
Merged
Conversation
|
Note regarding the |
stephentoub
reviewed
Mar 20, 2024
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs
Show resolved
Hide resolved
stephentoub
reviewed
Mar 20, 2024
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
stephentoub
approved these changes
Mar 20, 2024
Member
stephentoub
left a comment
There was a problem hiding this comment.
Other than the comments on tests, LGTM. Thanks.
Contributor
carlossanlop
left a comment
There was a problem hiding this comment.
Looks good so far, thanks! Please also add some tests proving the new API works as expected.
Contributor
carlossanlop
left a comment
There was a problem hiding this comment.
Thanks! Left some more suggestions for you to consider.
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.MessageMode.Windows.cs
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.MessageMode.Windows.cs
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.MessageMode.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.MessageMode.Windows.cs
Outdated
Show resolved
Hide resolved
carlossanlop
approved these changes
Mar 26, 2024
Contributor
carlossanlop
left a comment
There was a problem hiding this comment.
LGTM!
And thanks for also moving those unrelated windows and unix tests to their own file, even thought they were not part of the PR.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.