1CURLOPT_TCP_FASTOPEN(3) curl_easy_setopt options CURLOPT_TCP_FASTOPEN(3)
2
3
4
6 CURLOPT_TCP_FASTOPEN - TCP Fast Open
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_FASTOPEN, long enable);
12
14 Pass a long as parameter set to 1L to enable or 0 to disable.
15
16 TCP Fast Open (RFC7413) 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
22 0
23
25 All
26
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
31 curl_easy_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
32 curl_easy_perform(curl);
33 }
34
36 Added in 7.49.0. This option is currently only supported on Linux and
37 macOS 10.11 or later.
38
40 Returns CURLE_OK if fast open is supported by the operating system,
41 otherwise returns CURLE_NOT_BUILT_IN.
42
44 CURLOPT_SSL_FALSESTART(3),
45
46
47
48libcurl 8.0.1 January 02, 2023 CURLOPT_TCP_FASTOPEN(3)