Make ConnectHelper.ConnectAsync return ValueTask<Stream> (dotnet/corefx#24244)
authorStephen Toub <stoub@microsoft.com>
Tue, 26 Sep 2017 14:30:44 +0000 (10:30 -0400)
committerGitHub <noreply@github.com>
Tue, 26 Sep 2017 14:30:44 +0000 (10:30 -0400)
Minor optimization via playing a bit better perf-wise with changes being made in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/c45e6b3d58af63299aea992848370fced532c6e8

src/libraries/System.Net.Http/src/System/Net/Http/Managed/ConnectHelper.cs

index 4bf3efa..d96ff65 100644 (file)
@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
+using System.IO;
 using System.Net.Sockets;
 using System.Threading.Tasks;
 
@@ -9,7 +10,7 @@ namespace System.Net.Http
 {
     internal static class ConnectHelper
     {
-        public static async ValueTask<NetworkStream> ConnectAsync(string host, int port)
+        public static async ValueTask<Stream> ConnectAsync(string host, int port)
         {
             var socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
             try