CURLMOPT_MAXCONNECTS.3 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_MAXCONNECTS 3 "17 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLMOPT_MAXCONNECTS \- size of connection cache
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAXCONNECTS, long max);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass a long indicating the \fBmax\fP. The set number will be used as the
  35. maximum amount of simultaneously open connections that libcurl may keep in its
  36. connection cache after completed use. By default libcurl will enlarge the size
  37. for each added easy handle to make it fit 4 times the number of added easy
  38. handles.
  39. By setting this option, you can prevent the cache size from growing beyond the
  40. limit set by you.
  41. When the cache is full, curl closes the oldest one in the cache to prevent the
  42. number of open connections from increasing.
  43. This option is for the multi handle's use only, when using the easy interface
  44. you should instead use the \fICURLOPT_MAXCONNECTS(3)\fP option.
  45. See \fICURLMOPT_MAX_TOTAL_CONNECTIONS(3)\fP for limiting the number of active
  46. connections.
  47. .SH DEFAULT
  48. See DESCRIPTION
  49. .SH PROTOCOLS
  50. All
  51. .SH EXAMPLE
  52. .nf
  53. CURLM *m = curl_multi_init();
  54. /* only keep 10 connections in the cache */
  55. curl_multi_setopt(m, CURLMOPT_MAXCONNECTS, 10L);
  56. .fi
  57. .SH AVAILABILITY
  58. Added in 7.16.3
  59. .SH RETURN VALUE
  60. Returns CURLM_OK if the option is supported, and CURLM_UNKNOWN_OPTION if not.
  61. .SH "SEE ALSO"
  62. .BR CURLMOPT_MAX_HOST_CONNECTIONS "(3), "
  63. .BR CURLOPT_MAXCONNECTS "(3), "