CURLMOPT_MAX_CONCURRENT_STREAMS(3)
π CURLMOPT_MAX_CONCURRENT_STREAMS(3) π
okay bestie, welcome to the Library Functions Manual section, where we talk about CURLMOPT_MAX_CONCURRENT_STREAMS β say that five times fast, I dare you π this one is literally the "how many streams tho" knob for your multi handle. let's get into it β¨
πΈ NAME πΈ
CURLMOPT_MAX_CONCURRENT_STREAMS β the max concurrent streams for http2, no cap π«Ά
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_CONCURRENT_STREAMS,
long max);
so you're gonna pull in the header, then hit curl_multi_setopt with your multi handle, the option name, and a long max. that's the whole vibe π
π¦ DESCRIPTION π¦
okay so here's the tea β β you pass a long that indicates the max. that number you set? it becomes the maximum number of concurrent streams libcurl should support on connections done using HTTP/2 or HTTP/3. it's giving "how many lanes on the highway" energy π₯
valid values range from 1 to 2147483647 (2^31 - 1), and it defaults to 100. periodt π
but real talk β the value you pass here would be honored based on other system resources properties. so like, it's a request, not a guarantee, and the system gets a say too π keep that in mind bestie, it's important.
π DEFAULT π
100
that's the starting point, the factory setting, the main character default π
π PROTOCOLS π
this functionality affects http only. just http. that's it. that's the whole list π
π EXAMPLE π
here's what it looks like in the wild, copy-paste ready:
int main(void)
{
CURLM *m = curl_multi_init();
/* max concurrent streams 200 */
curl_multi_setopt(m, CURLMOPT_MAX_CONCURRENT_STREAMS, 200L);
}
see that 200L? we said 200 streams. icon behavior honestly π
β AVAILABILITY β
Added in curl 7.67.0 β so if you're on something ancient, this one's not gonna be there for you, sorry bestie π
π§ RETURN VALUE π§
curl_multi_setopt(3) returns a CURLMcode indicating success or error. so like, always check it, okay? π«Ά
CURLM_OK(0) means everything was OK π- non-zero means an error occurred β go see
libcurl-errors(3)for the whole breakdown π
π SEE ALSO π
go read those too, they're the sibling energy this page deserves πΈ
heads up bestie: that upper bound is literally2147483647(2^31 - 1), so don't go passing something wilder than that and expecting slay behavior π
and that's the whole page! brought to you by libcurl, dated 2026-10-12 β mwah, go forth and stream responsibly π β¨π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms