CURLOPT_PIPEWAIT.3 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, 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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_PIPEWAIT 3 "12 May 2015" "libcurl 7.43.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_PIPEWAIT \- wait for pipelining/multiplexing
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PIPEWAIT, long wait);
  30. .fi
  31. .SH DESCRIPTION
  32. Set \fIwait\fP to 1L to tell libcurl to prefer to wait for a connection to
  33. confirm or deny that it can do pipelining or multiplexing before continuing.
  34. When about to perform a new transfer that allows pipelining or multiplexing,
  35. libcurl will check for existing connections to re-use and pipeline on. If no
  36. such connection exists it will immediately continue and create a fresh new
  37. connection to use.
  38. By setting this option to 1 - and having \fICURLMOPT_PIPELINING(3)\fP enabled
  39. for the multi handle this transfer is associated with - libcurl will instead
  40. wait for the connection to reveal if it is possible to pipeline/multiplex on
  41. before it continues. This enables libcurl to much better keep the number of
  42. connections to a minimum when using pipelining or multiplexing protocols.
  43. The effect thus becomes that with this option set, libcurl prefers to wait and
  44. re-use an existing connection for pipelining rather than the opposite: prefer
  45. to open a new connection rather than waiting.
  46. The waiting time is as long as it takes for the connection to get up and for
  47. libcurl to get the necessary response back that informs it about its protocol
  48. and support level.
  49. .SH DEFAULT
  50. 0 (off)
  51. .SH PROTOCOLS
  52. HTTP(S)
  53. .SH EXAMPLE
  54. .nf
  55. CURL *curl = curl_easy_init();
  56. if(curl) {
  57. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  58. curl_easy_setopt(curl, CURLOPT_PIPEWAIT, 1L);
  59. /* now add this easy handle to the multi handle */
  60. }
  61. .fi
  62. .SH AVAILABILITY
  63. Added in 7.43.0
  64. .SH RETURN VALUE
  65. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  66. .SH "SEE ALSO"
  67. .BR CURLOPT_FORBID_REUSE "(3), " CURLOPT_FRESH_CONNECT "(3), "
  68. .BR CURLMOPT_PIPELINING "(3), " CURLMOPT_MAX_HOST_CONNECTIONS "(3), "