1CURLOPT_HAPPY_EYEBALLS_TIMEOcUuTr_lM_Se(a3s)y_setoptCUoRpLtOiPoTn_sHAPPY_EYEBALLS_TIMEOUT_MS(3)
2
3
4

NAME

6       CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS  - head start for ipv6 for happy eye‐
7       balls
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS,
13                                 long timeout);
14

DESCRIPTION

16       Happy eyeballs is an algorithm that attempts to connect  to  both  IPv4
17       and  IPv6  addresses  for  dual-stack  hosts, preferring IPv6 first for
18       timeout milliseconds. If the IPv6 address cannot be connected to within
19       that time then a connection attempt is made to the IPv4 address in par‐
20       allel. The first connection to be established is the one that is used.
21
22       The range of suggested useful values for timeout is limited. Happy Eye‐
23       balls  RFC  6555  says  "It  is RECOMMENDED that connection attempts be
24       paced 150-250 ms apart to balance human factors against network  load."
25       libcurl  currently defaults to 200 ms. Firefox and Chrome currently de‐
26       fault to 300 ms.
27

DEFAULT

29       CURL_HET_DEFAULT (currently defined as 200L)
30

PROTOCOLS

32       All except FILE
33

EXAMPLE

35       CURL *curl = curl_easy_init();
36       if(curl) {
37         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
38         curl_easy_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, 300L);
39
40         curl_easy_perform(curl);
41
42         /* always cleanup */
43         curl_easy_cleanup(curl);
44       }
45

AVAILABILITY

47       Added in 7.59.0
48

RETURN VALUE

50       Returns CURLE_OK
51

SEE ALSO

53       CURLOPT_CONNECTTIMEOUT_MS(3),         CURLOPT_TIMEOUT(3),          CUR‐
54       LOPT_LOW_SPEED_LIMIT(3),
55
56
57
58libcurl 7.82.0                 November 26,CU2R0L2O1PT_HAPPY_EYEBALLS_TIMEOUT_MS(3)
Impressum