mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Fix #110 - enable asynchronous mode for Stream transport on Windows
This commit is contained in:
@@ -12,12 +12,18 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections
|
|||||||
#pragma warning disable 1998 // Because in the NET451 code path, there's nothing to await
|
#pragma warning disable 1998 // Because in the NET451 code path, there's nothing to await
|
||||||
public override async Task<Stream> Open(string address)
|
public override async Task<Stream> Open(string address)
|
||||||
{
|
{
|
||||||
_namedPipeClientStream = new NamedPipeClientStream(".", address, PipeDirection.InOut);
|
_namedPipeClientStream = new NamedPipeClientStream(
|
||||||
|
".",
|
||||||
|
address,
|
||||||
|
PipeDirection.InOut,
|
||||||
|
PipeOptions.Asynchronous);
|
||||||
|
|
||||||
#if NET451
|
#if NET451
|
||||||
_namedPipeClientStream.Connect();
|
_namedPipeClientStream.Connect();
|
||||||
#else
|
#else
|
||||||
await _namedPipeClientStream.ConnectAsync().ConfigureAwait(false);
|
await _namedPipeClientStream.ConnectAsync().ConfigureAwait(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return _namedPipeClientStream;
|
return _namedPipeClientStream;
|
||||||
}
|
}
|
||||||
#pragma warning restore 1998
|
#pragma warning restore 1998
|
||||||
|
|||||||
Reference in New Issue
Block a user