Skip to content

Commit

Permalink
Make ConnectHelper.ConnectAsync return ValueTask<Stream> (dotnet/core…
Browse files Browse the repository at this point in the history
…fx#24244)

Minor optimization via playing a bit better perf-wise with changes being made in coreclr.

Commit migrated from dotnet/corefx@c45e6b3
  • Loading branch information
stephentoub authored Sep 26, 2017
1 parent 1677c52 commit a013bc3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// 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;

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
Expand Down

0 comments on commit a013bc3

Please sign in to comment.