Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Make ConnectHelper.ConnectAsync return ValueTask<Stream> (#24244)
Browse files Browse the repository at this point in the history
Minor optimization via playing a bit better perf-wise with changes being made in coreclr.
  • Loading branch information
stephentoub authored Sep 26, 2017
1 parent 2f981c6 commit c45e6b3
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 c45e6b3

Please sign in to comment.