Skip to content

Commit 2f5b992

Browse files
Revert
1 parent 1a9f529 commit 2f5b992

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/Microsoft.ServiceHub.Framework/AsyncNamedPipeClientStream.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3-
#if WINDOWS
3+
44
using System.IO.Pipes;
55
using System.Runtime.InteropServices;
66
using System.Runtime.Versioning;
@@ -198,22 +198,3 @@ private Windows.Win32.Security.SECURITY_ATTRIBUTES GetSecurityAttributes(bool in
198198
return secAttr;
199199
}
200200
}
201-
#else
202-
using System.IO.Pipes;
203-
204-
#pragma warning disable SA1600 // Elements should be documented
205-
internal class AsyncNamedPipeClientStream : PipeStream
206-
{
207-
internal AsyncNamedPipeClientStream(PipeDirection direction, int bufferSize)
208-
: base(direction, bufferSize)
209-
{
210-
}
211-
212-
internal AsyncNamedPipeClientStream(PipeDirection direction, PipeTransmissionMode transmissionMode, int outBufferSize)
213-
: base(direction, transmissionMode, outBufferSize)
214-
{
215-
}
216-
}
217-
#pragma warning restore SA1600 // Elements should be documented
218-
219-
#endif

src/Microsoft.ServiceHub.Framework/ServerFactory.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
using System.Diagnostics;
66
using System.IO.Pipes;
77
using System.Runtime.InteropServices;
8+
using System.Runtime.Versioning;
89
using System.Security.Principal;
910
using Windows.Win32.Foundation;
10-
#if WINDOWS
1111
using static Windows.Win32.PInvoke;
12-
#endif
1312

1413
namespace Microsoft.ServiceHub.Framework;
1514

@@ -103,7 +102,6 @@ public static async Task<Stream> ConnectAsync(string pipeName, ClientOptions opt
103102
PipeStream? pipeStream = null;
104103
try
105104
{
106-
#if WINDOWS
107105
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
108106
{
109107
pipeStream = new AsyncNamedPipeClientStream(".", name, PipeDirection.InOut, pipeOptions);
@@ -114,10 +112,6 @@ public static async Task<Stream> ConnectAsync(string pipeName, ClientOptions opt
114112
pipeStream = new NamedPipeClientStream(".", name, PipeDirection.InOut, pipeOptions);
115113
await ConnectWithRetryAsync((NamedPipeClientStream)pipeStream, fullPipeOptions, cancellationToken, maxRetries, withSpinningWait: options.CpuSpinOverFirstChanceExceptions).ConfigureAwait(false);
116114
}
117-
#else
118-
pipeStream = new NamedPipeClientStream(".", name, PipeDirection.InOut, pipeOptions);
119-
await ConnectWithRetryAsync((NamedPipeClientStream)pipeStream, fullPipeOptions, cancellationToken, maxRetries, withSpinningWait: options.CpuSpinOverFirstChanceExceptions).ConfigureAwait(false);
120-
#endif
121115

122116
return pipeStream;
123117
}

0 commit comments

Comments
 (0)