Skip to content
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

Implement NamedPipeClientStream in the unityaot profile (case 1159863) #1192

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public NamedPipeClientStream (string serverName, string pipeName, PipeDirection
}

public NamedPipeClientStream (string serverName, string pipeName, PipeDirection direction, PipeOptions options, TokenImpersonationLevel impersonationLevel, HandleInheritability inheritability)
#if MOBILE
#if MOBILE && !UNITY_AOT
: base (direction, DefaultBufferSize)
{
throw new NotImplementedException ();
Expand All @@ -88,13 +88,17 @@ public NamedPipeClientStream (string serverName, string pipeName, PipeDirection
public NamedPipeClientStream (PipeDirection direction, bool isAsync, bool isConnected, SafePipeHandle safePipeHandle)
: base (direction, DefaultBufferSize)
{
#if MOBILE
#if MOBILE && !UNITY_AOT
throw new NotImplementedException ();
#else
if (IsWindows)
impl = new Win32NamedPipeClient (this, safePipeHandle);
else
#if UNITY_AOT
throw new NotImplementedException ();
#else
impl = new UnixNamedPipeClient (this, safePipeHandle);
#endif
IsConnected = isConnected;
InitializeHandle (safePipeHandle, true, isAsync);
#endif
Expand All @@ -106,13 +110,17 @@ public NamedPipeClientStream (string serverName, string pipeName, PipeAccessRigh
if (impersonationLevel != TokenImpersonationLevel.None ||
inheritability != HandleInheritability.None)
throw ThrowACLException ();
#if MOBILE
#if MOBILE && !UNITY_AOT
throw new NotImplementedException ();
#else
if (IsWindows)
impl = new Win32NamedPipeClient (this, serverName, pipeName, desiredAccessRights, options, inheritability);
else
#if UNITY_AOT
throw new NotImplementedException ();
#else
impl = new UnixNamedPipeClient (this, serverName, pipeName, desiredAccessRights, options, inheritability);
#endif
#endif

}
Expand All @@ -121,13 +129,13 @@ public NamedPipeClientStream (string serverName, string pipeName, PipeAccessRigh
Dispose (false);
}

#if !MOBILE
#if !MOBILE || UNITY_AOT
INamedPipeClient impl;
#endif

public void Connect ()
{
#if MOBILE
#if MOBILE && !UNITY_AOT
throw new NotImplementedException ();
#else
impl.Connect ();
Expand All @@ -138,7 +146,7 @@ public void Connect ()

public void Connect (int timeout)
{
#if MOBILE
#if MOBILE && !UNITY_AOT
throw new NotImplementedException ();
#else
impl.Connect (timeout);
Expand Down Expand Up @@ -174,7 +182,7 @@ protected override internal void CheckPipePropertyOperations () {
public int NumberOfServerInstances {
get {
CheckPipePropertyOperations ();
#if MOBILE
#if MOBILE && !UNITY_AOT
throw new NotImplementedException ();
#else
return impl.NumberOfServerInstances;
Expand Down
2 changes: 1 addition & 1 deletion mcs/class/System.Core/System.IO.Pipes/PipeStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class PipeStream : Stream
// FIXME: not precise.
internal const int DefaultBufferSize = 0x400;

#if !MOBILE
#if !MOBILE || UNITY_AOT
internal static bool IsWindows {
get { return Win32Marshal.IsWindows; }
}
Expand Down
1 change: 1 addition & 0 deletions mcs/class/System.Core/unityaot_System.Core.dll.sources
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include winaot_System.Core.dll.sources
../referencesource/System.Core/System/Linq/Enumerable.cs
corefx/SR.cs
System.IO.Pipes/PipeWin32.cs