• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLMOPT_MAX_CONCURRENT_STREAMS
5Section: 3
6Source: libcurl
7See-also:
8  - CURLMOPT_MAXCONNECTS (3)
9  - CURLOPT_MAXCONNECTS (3)
10Protocol:
11  - HTTP
12Added-in: 7.67.0
13---
14
15# NAME
16
17CURLMOPT_MAX_CONCURRENT_STREAMS - max concurrent streams for http2
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_CONCURRENT_STREAMS,
25                            long max);
26~~~
27
28# DESCRIPTION
29
30Pass a long indicating the **max**. The set number is used as the maximum
31number of concurrent streams libcurl should support on connections done using
32HTTP/2 or HTTP/3.
33
34Valid values range from 1 to 2147483647 (2^31 - 1) and defaults to 100. The
35value passed here would be honored based on other system resources properties.
36
37# DEFAULT
38
39100
40
41# %PROTOCOLS%
42
43# EXAMPLE
44
45~~~c
46int main(void)
47{
48  CURLM *m = curl_multi_init();
49  /* max concurrent streams 200 */
50  curl_multi_setopt(m, CURLMOPT_MAX_CONCURRENT_STREAMS, 200L);
51}
52~~~
53
54# %AVAILABILITY%
55
56# RETURN VALUE
57
58curl_multi_setopt(3) returns a CURLMcode indicating success or error.
59
60CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
61libcurl-errors(3).
62