CURLOPT_PIPEWAIT.3 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PIPEWAIT.md
  2. .TH CURLOPT_PIPEWAIT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PIPEWAIT \- wait for multiplexing
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PIPEWAIT, long wait);
  9. .fi
  10. .SH DESCRIPTION
  11. Set \fIwait\fP to 1L to tell libcurl to prefer to wait for a connection to
  12. confirm or deny that it can do multiplexing before continuing.
  13. When about to perform a new transfer that allows multiplexing, libcurl checks
  14. for existing connections to use. If no such connection exists it immediately
  15. continues and creates a fresh new connection to use.
  16. By setting this option to 1 \- and having \fICURLMOPT_PIPELINING(3)\fP enabled
  17. for the multi handle this transfer is associated with \- libcurl instead waits
  18. for the connection to reveal if it is possible to multiplex on before it
  19. continues. This enables libcurl to much better keep the number of connections
  20. to a minimum when using multiplexing protocols.
  21. With this option set, libcurl prefers to wait and reuse an existing connection
  22. for multiplexing rather than the opposite: prefer to open a new connection
  23. rather than waiting.
  24. The waiting time is as long as it takes for the connection to get up and for
  25. libcurl to get the necessary response back that informs it about its protocol
  26. and support level.
  27. .SH DEFAULT
  28. 0 (off)
  29. .SH PROTOCOLS
  30. This functionality affects http only
  31. .SH EXAMPLE
  32. .nf
  33. int main(void)
  34. {
  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_PIPEWAIT, 1L);
  39. /* now add this easy handle to the multi handle */
  40. }
  41. }
  42. .fi
  43. .SH AVAILABILITY
  44. Added in curl 7.43.0
  45. .SH RETURN VALUE
  46. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  47. .SH SEE ALSO
  48. .BR CURLMOPT_MAX_HOST_CONNECTIONS (3),
  49. .BR CURLMOPT_PIPELINING (3),
  50. .BR CURLOPT_FORBID_REUSE (3),
  51. .BR CURLOPT_FRESH_CONNECT (3)