From c8859abeb73d98ebc1a51d77b5c9a5809f390045 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 7 Jun 2016 11:36:38 +0100 Subject: [PATCH] Fix #110 - enable asynchronous mode for Stream transport on Windows --- .../PhysicalConnections/NamedPipeConnection.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs index 0d0d79b..7a980cf 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs @@ -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 public override async Task Open(string address) { - _namedPipeClientStream = new NamedPipeClientStream(".", address, PipeDirection.InOut); + _namedPipeClientStream = new NamedPipeClientStream( + ".", + address, + PipeDirection.InOut, + PipeOptions.Asynchronous); + #if NET451 _namedPipeClientStream.Connect(); #else await _namedPipeClientStream.ConnectAsync().ConfigureAwait(false); #endif + return _namedPipeClientStream; } #pragma warning restore 1998