-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support setting NamedPipeClientStream.ReadMode with PipeAccessRights ctor overload #100001
Support setting NamedPipeClientStream.ReadMode with PipeAccessRights ctor overload #100001
Conversation
Note regarding the
|
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the comments on tests, LGTM. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, thanks! Please also add some tests proving the new API works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Fixes #83072 (Cannot set ReadMode after creating a NamedPipeClientStream instance).
Per the API Review notes and video:
NamedPipeClientStream
that acceptsPipeAccessRights
PipeAccessRights
from 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.
direction
argument is given a valid value when thedesiredAccessRights
value is invalid, ensuring that the correctdesiredAccessRights
argument exception is throwndesiredAccessRights
value missing both theReadData
(1) andWriteData
(2) bits would throw an argument exception fordirection
, which is not an argument to the constructordesiredAccessRights
also throws for a0
value, 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.