1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-08 23:42:08 +03:00

HappyEyeballs (#7035)

This doesn't yet introduce any mechanism to enable or disable
happy eyeballs.

It also doesn't sort IP addresses to alternate IPv6, IPv4
for best success.

It also doesn't limit how many connections are attempted
simultaneously.

It also lacks an appropriate number of tests.
This commit is contained in:
Jesse Wilson
2022-01-28 11:11:05 -05:00
committed by GitHub
parent d4b5c9eac8
commit f15c81b4e9
11 changed files with 359 additions and 37 deletions

View File

@@ -114,9 +114,10 @@ class OkHttpClientTestRule : BeforeEachCallback, AfterEachCallback {
var client = testClient
if (client == null) {
client = OkHttpClient.Builder()
.dns(SINGLE_INET_ADDRESS_DNS) // Prevent unexpected fallback addresses.
.eventListenerFactory { ClientRuleEventListener(logger = ::addEvent) }
.build()
.fastFallback(true) // Test this by default, since it'll soon be the default.
.dns(SINGLE_INET_ADDRESS_DNS) // Prevent unexpected fallback addresses.
.eventListenerFactory { ClientRuleEventListener(logger = ::addEvent) }
.build()
testClient = client
}
return client