GNURLMOPT...ONNECTIONS(3)
π GNURLMOPT_MAX_TOTAL_CONNECTIONS(3) β curl_multi_setopt options
okay bestie, listen β this is the gnurl flavor of the curl_multi_setopt options page, and today's main character is CURLMOPT_MAX_TOTAL_CONNECTIONS. she's the bouncer at the club door of your multi handle and she will count everyone. no cap. π
β¨ NAME β¨
CURLMOPT_MAX_TOTAL_CONNECTIONS β the max number of simultaneously open connections, like, total. not per host, not per vibe, total. π
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLMcode curl_multi_setopt(CURLM *handle,
CURLMOPT_MAX_TOTAL_CONNECTIONS, long amount);
π¦ DESCRIPTION π¦
okay so you pass a long in as the amount, right? that number becomes the maximum number of simultaneously open connections in total using this multi handle. literally the whole squad, one cap. π
so for every new session, libcurl opens a new connection β but only up to the limit you set with CURLMOPT_MAX_TOTAL_CONNECTIONS(3). once you hit that limit? the sessions just... wait. pending. hanging out in the group chat until a connection frees up. π no cutting the line, bestie.
and if CURLMOPT_PIPELINING(3) is enabled, libcurl will try to pipeline or use multiplexing if the host is capable of it β like carpooling to the function instead of everyone driving separately. iconic behavior honestly. πβ¨
π DEFAULT π
the default value is 0, which means there is no limit. ngl, wild. in that case it's simply controlled by the number of easy handles you added β so the easy handles are running the show. main character energy from them, I guess. π
π PROTOCOLS π
All β every single one. she's versatile like that. β
π EXAMPLE π
CURLM *m = curl_multi_init();
/* never do more than 15 connections */
curl_multi_setopt(m, CURLMOPT_MAX_TOTAL_CONNECTIONS, 15L);
see that? fifteen. that's the ceiling. the whole squad of 15 and not one more, periodt. π₯
π AVAILABILITY π
Added in 7.30.0 β she's been serving since then, iykyk. π«
π RETURN VALUE π
returns CURLM_OK if the option is supported β slay, we're so back β and CURLM_UNKNOWN_OPTION if it's not. ππ
lowkey important: CURLM_UNKNOWN_OPTION is your sign that this build just doesn't know her. don't take it personally, bestie. π«Ά
π₯ SEE ALSO π₯
that's the whole page, bestie β go forth and cap your connections responsibly πβ¨
libcurl 7.39.0 Β· 4 Nov 2014 β yeah that's the version and date down at the bottom, mwah, bye! ππ§
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms