This proposal adds APIs needed to implement RFC 8305 "Happy Eyeballs" in Socket.ConnectAsync. This depends on #939.
The simplified description of Happy Eyeballs is that it makes A and AAAA DNS requests in parallel, and then goes back and forth between A and AAAA beginning parallel Connect() at a set interval until it has a connection. This trades more overhead for improved latency of the root ConnectAsync call.
See #26177 (comment) where we decided to explore this as a general Socket feature rather than only SocketsHttpClient.
(API has cancellation support added where there previously hasn't been, to avoid needing to add yet more APIs later. See related #921)
classSystem.Net.Sockets.Socket
{publicstaticboolConnectAsync(SocketTypesocketType,ProtocolTypeprotocolType,SocketAsyncEventArgse,ConnectAlgorithmconnectAlgorithm);}enumSystem.Net.Sockets.ConnectAlgorithm
{// use existing behavior.Default,// use a Happy Eyeballs-like algorithm to connect.Parallel=1}#26177 would be implemented using this, but is not blocked by it.
This proposal adds APIs needed to implement RFC 8305 "Happy Eyeballs" in
Socket.ConnectAsync. This depends on #939.The simplified description of Happy Eyeballs is that it makes A and AAAA DNS requests in parallel, and then goes back and forth between A and AAAA beginning parallel
Connect()at a set interval until it has a connection. This trades more overhead for improved latency of the rootConnectAsynccall.See #26177 (comment) where we decided to explore this as a general
Socketfeature rather than onlySocketsHttpClient.(API has cancellation support added where there previously hasn't been, to avoid needing to add yet more APIs later. See related #921)
#26177 would be implemented using this, but is not blocked by it.