-
Notifications
You must be signed in to change notification settings - Fork 3.8k
System.IO.Pipes from CoreFX #9573
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9ce9eaa
Use System.IO.Pipes from CoreFX.
filipnavara 33a0cb1
Path.IsPathRooted should not throw on invalid characters.
filipnavara fe362ce
Adjust test list.
filipnavara 4f04909
Fix couple more of profiles.
filipnavara befa288
Add two Span overloads for Socket to fix compilation of PipeStream.Un…
filipnavara b85afb1
Update basic and build profiles.
filipnavara 4744ed4
Disable Unix specific test.
filipnavara 7048c7a
Revert Path.IsPathRooted to the NetFX behavior (which is different fr…
filipnavara 6685bab
Fix test conditions on Linux.
filipnavara 53f4715
Fix unreal profile.
filipnavara 26083da
Add missing methods from System.IO.Pipes.
filipnavara 2cf40dd
Reworked approach for the PipeSecurity constructor overloads.
filipnavara f3726e2
Remove non-existant files from .sources.
filipnavara 071d739
[csproj] Update project files
monojenkins a8e2b40
Fix Windows build.
filipnavara 607811d
Remove TransmissionMode setter.
filipnavara 2fa4e8c
Bump corefx and remove duplicate code.
filipnavara a848456
Fix whitespace.
filipnavara 0538c2e
Code style fixes.
filipnavara 354db46
Remove unnecessary attribute.
filipnavara 8fd1900
Add pipes_pns.sources and reference it from other .sources.
filipnavara 46871e9
Revert unintentional change.
filipnavara 03be151
Bump corefx and use UnixDomainSocketEndPoint from there.
filipnavara dca1fd3
Merge remote-tracking branch 'upstream/master' into corefx-pipes
monojenkins 40001d4
Bump API snapshot submodule
monojenkins b9ea8b2
[csproj] Update project files
monojenkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule api-snapshot
updated
6 files
| +9 −41 | profiles/monodroid/System.Core.cs | |
| +2 −0 | profiles/monodroid/System.cs | |
| +9 −41 | profiles/monotouch/System.Core.cs | |
| +2 −0 | profiles/monotouch/System.cs | |
| +15 −42 | profiles/net_4_x/System.Core.cs | |
| +2 −0 | profiles/net_4_x/System.cs |
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
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
102 changes: 0 additions & 102 deletions
102
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.NotSupported.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using Microsoft.Win32.SafeHandles; | ||
| using System.Diagnostics; | ||
| using System.Security; | ||
|
|
||
| namespace System.IO.Pipes | ||
| { | ||
| /// <summary> | ||
| /// Anonymous pipe server stream | ||
| /// </summary> | ||
| public sealed partial class AnonymousPipeServerStream : PipeStream | ||
| { | ||
| public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) | ||
| : base (PipeDirection.In, 0) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| // Creates the anonymous pipe. | ||
| private unsafe void Create (PipeDirection direction, HandleInheritability inheritability, int bufferSize) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.Unix.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| namespace System.IO.Pipes | ||
| { | ||
| public sealed partial class AnonymousPipeServerStream | ||
| { | ||
| public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) | ||
| : this (direction, inheritability, bufferSize) | ||
| { | ||
| if (pipeSecurity != null) { | ||
| throw new PlatformNotSupportedException (); | ||
| } | ||
| } | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.Windows.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| using Microsoft.Win32.SafeHandles; | ||
| using System.Diagnostics; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace System.IO.Pipes | ||
| { | ||
| public sealed partial class AnonymousPipeServerStream | ||
| { | ||
| public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity) | ||
| : base (direction, bufferSize) | ||
| { | ||
| if (direction == PipeDirection.InOut) { | ||
| throw new NotSupportedException(SR.NotSupported_AnonymousPipeUnidirectional); | ||
| } | ||
| if (inheritability < HandleInheritability.None || inheritability > HandleInheritability.Inheritable) { | ||
| throw new ArgumentOutOfRangeException(nameof(inheritability), SR.ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable); | ||
| } | ||
|
|
||
| Create(direction, inheritability, bufferSize, pipeSecurity); | ||
| } | ||
| } | ||
| } | ||
154 changes: 0 additions & 154 deletions
154
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeServerStream.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I am not sure about the practices on Moni repo but this file should be exactly like the one in CoreFx except for this constructor, correct? If yes, perhaps it is better to have the constructors that don't exist in CoreFx on separate files so whenever new changes are picked up from CoreFx these constructors are not involved in the diff. Same for the other locations.
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.
These files don't mirror CoreFX (except for the Create methods that I am about to remove once/if dotnet/corefx#31118 is merged). The CoreFX files are linked directly by path (../../../external/corefx/src/[something]). The file names are TBD, not sure about the conventions.
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.
Specifically, the CoreFX files are referenced directly from various .sources files (and .csproj is generated from that). The .cs files that are left in the Mono repository fill in the missing pieces, in this case the constructors with the PipeStream parameter. Ideally these files should be as small as possible, which is not the case here just yet. It will probably take couple more iterations to get there (PRs on CoreFX upstream, PRs/cherry-picks to Mono's CoreFX forked repository and this PR).
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 for the explanation. I will keep an eye on this PR so I get more familiar with Mono.