dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.86k stars 4.62k forks source link

Happy Eyeballs support in Socket.ConnectAsync #87932

Open liveans opened 1 year ago

liveans commented 1 year ago

This API has been proposed and approved on https://github.com/dotnet/runtime/issues/861. Since we're closing the mega-issue(https://github.com/dotnet/runtime/issues/33418) we'll track this here.

class Socket
{
    // existing: public static bool ConnectAsync(SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e);
    public static bool ConnectAsync (SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e, ConnectAlgorithm connectAlgorithm);
}

// new enum
enum ConnectAlgorithm
{
    // use existing behavior.
    Default,

    // use a Happy Eyeballs-like algorithm to connect.
    Parallel = 1
}
ghost commented 1 year ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Issue Details
This API has been proposed and approved on https://github.com/dotnet/runtime/issues/861. Since we're closing the mega-issue(https://github.com/dotnet/runtime/issues/33418) we'll track this here. ```c# class Socket { // existing: public static bool ConnectAsync(SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e); public static bool ConnectAsync (SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e, ConnectAlgorithm connectAlgorithm); } // new enum enum ConnectAlgorithm { // use existing behavior. Default, // use a Happy Eyeballs-like algorithm to connect. Parallel = 1 } ```
Author: liveans
Assignees: -
Labels: `api-approved`, `area-System.Net.Sockets`
Milestone: -
wfurt commented 1 year ago

related to #26177