CURLOPT_TCP_FASTOPEN.3 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TCP_FASTOPEN.md
  2. .TH CURLOPT_TCP_FASTOPEN 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TCP_FASTOPEN \- TCP Fast Open
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_FASTOPEN, long enable);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long as parameter set to 1L to enable or 0 to disable.
  12. TCP Fast Open (RFC 7413) is a mechanism that allows data to be carried in the
  13. SYN and SYN\-ACK packets and consumed by the receiving end during the initial
  14. connection handshake, saving up to one full round\-trip time (RTT).
  15. Beware: the TLS session cache does not work when TCP Fast Open is enabled. TCP
  16. Fast Open is also known to be problematic on or across certain networks.
  17. .SH DEFAULT
  18. 0
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  28. curl_easy_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
  29. curl_easy_perform(curl);
  30. }
  31. }
  32. .fi
  33. .SH NOTES
  34. This option is only supported on Linux and macOS 10.11 or later.
  35. .SH AVAILABILITY
  36. Added in curl 7.49.0
  37. .SH RETURN VALUE
  38. Returns CURLE_OK if fast open is supported by the operating system, otherwise
  39. returns CURLE_NOT_BUILT_IN.
  40. .SH SEE ALSO
  41. .BR CURLOPT_SSL_FALSESTART (3)