CURLOPT_PIPEWAIT.3 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_PIPEWAIT 3 "12 May 2015" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_PIPEWAIT \- wait for pipelining/multiplexing
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PIPEWAIT, long wait);
  32. .fi
  33. .SH DESCRIPTION
  34. Set \fIwait\fP to 1L to tell libcurl to prefer to wait for a connection to
  35. confirm or deny that it can do pipelining or multiplexing before continuing.
  36. When about to perform a new transfer that allows pipelining or multiplexing,
  37. libcurl will check for existing connections to re-use and pipeline on. If no
  38. such connection exists it will immediately continue and create a fresh new
  39. connection to use.
  40. By setting this option to 1 - and having \fICURLMOPT_PIPELINING(3)\fP enabled
  41. for the multi handle this transfer is associated with - libcurl will instead
  42. wait for the connection to reveal if it is possible to pipeline/multiplex on
  43. before it continues. This enables libcurl to much better keep the number of
  44. connections to a minimum when using pipelining or multiplexing protocols.
  45. The effect thus becomes that with this option set, libcurl prefers to wait and
  46. re-use an existing connection for pipelining rather than the opposite: prefer
  47. to open a new connection rather than waiting.
  48. The waiting time is as long as it takes for the connection to get up and for
  49. libcurl to get the necessary response back that informs it about its protocol
  50. and support level.
  51. .SH DEFAULT
  52. 0 (off)
  53. .SH PROTOCOLS
  54. HTTP(S)
  55. .SH EXAMPLE
  56. .nf
  57. CURL *curl = curl_easy_init();
  58. if(curl) {
  59. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  60. curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L);
  61. /* now add this easy handle to the multi handle */
  62. }
  63. .fi
  64. .SH AVAILABILITY
  65. Added in 7.43.0
  66. .SH RETURN VALUE
  67. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  68. .SH "SEE ALSO"
  69. .BR CURLOPT_FORBID_REUSE "(3), " CURLOPT_FRESH_CONNECT "(3), "
  70. .BR CURLMOPT_PIPELINING "(3), " CURLMOPT_MAX_HOST_CONNECTIONS "(3), "