CURLMOPT_MAX_TOTAL_CONNECTIONS.3 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 CURLMOPT_MAX_TOTAL_CONNECTIONS 3 "4 Nov 2014" libcurl libcurl
  26. .SH NAME
  27. CURLMOPT_MAX_TOTAL_CONNECTIONS \- max simultaneously open connections
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_TOTAL_CONNECTIONS,
  32. long amount);
  33. .fi
  34. .SH DESCRIPTION
  35. Pass a long for the \fBamount\fP. The set number will be used as the maximum
  36. number of simultaneously open connections in total using this multi
  37. handle. For each new session, libcurl will open a new connection up to the
  38. limit set by \fICURLMOPT_MAX_TOTAL_CONNECTIONS(3)\fP. When the limit is
  39. reached, the sessions will be pending until there are available
  40. connections. If \fICURLMOPT_PIPELINING(3)\fP is enabled, libcurl will try to
  41. use multiplexing if the host is capable of it.
  42. When more transfers are added to the multi handle than what can be performed
  43. due to the set limit, they will be queued up waiting for their chance. When
  44. that happens, the \fICURLOPT_TIMEOUT_MS(3)\fP timeout will be counted
  45. inclusive of the waiting time, meaning that if you set a too narrow timeout in
  46. such a case the transfer might never even start before it times out.
  47. Even in the queued up situation, the \fICURLOPT_CONNECTTIMEOUT_MS(3)\fP
  48. timeout is however treated as a per-connect timeout.
  49. .SH DEFAULT
  50. The default value is 0, which means that there is no limit. It is then simply
  51. controlled by the number of easy handles added.
  52. .SH PROTOCOLS
  53. All
  54. .SH EXAMPLE
  55. .nf
  56. CURLM *m = curl_multi_init();
  57. /* never do more than 15 connections */
  58. curl_multi_setopt(m, CURLMOPT_MAX_TOTAL_CONNECTIONS, 15L);
  59. .fi
  60. .SH AVAILABILITY
  61. Added in 7.30.0
  62. .SH RETURN VALUE
  63. Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
  64. .SH "SEE ALSO"
  65. .BR CURLMOPT_MAXCONNECTS "(3), " CURLMOPT_MAX_HOST_CONNECTIONS "(3), "