1CURLOPT_TCP_FASTOPEN(3)             libcurl            CURLOPT_TCP_FASTOPEN(3)
2
3
4

NAME

6       CURLOPT_TCP_FASTOPEN - TCP Fast Open
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_FASTOPEN, long enable);
12

DESCRIPTION

14       Pass a long as parameter set to 1L to enable or 0 to disable.
15
16       TCP  Fast Open (RFC 7413) is a mechanism that allows data to be carried
17       in the SYN and SYN-ACK packets and consumed by the receiving end during
18       the initial connection handshake, saving up to one full round-trip time
19       (RTT).
20
21       Beware: the TLS session cache does not work when TCP Fast Open  is  en‐
22       abled.  TCP Fast Open is also known to be problematic on or across cer‐
23       tain networks.
24

DEFAULT

26       0
27

PROTOCOLS

29       All
30

EXAMPLE

32       CURL *curl = curl_easy_init();
33       if(curl) {
34         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
35         curl_easy_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
36         curl_easy_perform(curl);
37       }
38

AVAILABILITY

40       Added in 7.49.0. This option is currently only supported on  Linux  and
41       macOS 10.11 or later.
42

RETURN VALUE

44       Returns  CURLE_OK  if  fast  open is supported by the operating system,
45       otherwise returns CURLE_NOT_BUILT_IN.
46

SEE ALSO

48       CURLOPT_SSL_FALSESTART(3),
49
50
51
52ibcurl 8.2.1                     June 25, 2023         CURLOPT_TCP_FASTOPEN(3)
Impressum