curl_multi_socket_all(3)
π curl_multi_socket_all β the "check literally everything" era π
okay so bestie, welcome to the curl_multi_socket_all(3) page from the libcurl manual. yes the header says curl_multi_socket_all(3), and yes it's a Library Functions Manual situation, and yes I'm gonna walk you through it like we're on FaceTime at 1am. sit down, hydrate, let's go π
β¨ NAME β¨
curl_multi_socket_all β reads/writes available data for all easy handles. all of them. every last one. no crumbs. π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLMcode curl_multi_socket_all(CURLM *multi_handle,
int *running_handles);
that's the whole vibe. one include, one call. copy it exactly, don't freestyle the signature bestie π
πΈ DESCRIPTION πΈ
okay so first things first, and I need you to hear me on this: this function is deprecated for performance reasons π«Ά but β and this is the iconic part β there are no plans to remove it from the API. so she's retired but she's still on the guest list. use curl_multi_socket_action(3) instead. that's the main character now.
at return, the integer that running_handles points to contains the number of still running easy handles within the multi handle. when this number reaches zero, all transfers are complete/done. zero = we ate. π
so what does the call actually do? it forces libcurl to (re-)check all its internal sockets and transfers instead of just a single one β that's the whole point of calling curl_multi_socket_all(3). but ngl, note that there should not be any reason to use this function. like, none. it's giving "backup dancer who's been here since 2006." π
π§ PROTOCOLS π§
this functionality affects all supported protocols β every single one, she's inclusive like that π
π EXAMPLE π
int main(void)
{
int running;
int rc;
CURLM *multi = curl_multi_init();
rc = curl_multi_socket_all(multi, &running);
}
look at her go. curl_multi_init() to set up the multi handle, then one curl_multi_socket_all() call with &running so you can peek at how many handles are still going. slay. β¨
π AVAILABILITY π
Added in curl 7.15.4. she's an elder. respect her. π
π RETURN VALUE π
this function returns a CURLMcode indicating success or error.
CURLM_OK(0) means everything was OK π’- non-zero means an error occurred β see
libcurl-errors(3)for the deets π΄
and important caveat time, bestie, because this one matters: the return code is for the whole multi stack. problems still might have occurred on individual transfers even when one of these functions returns OK. so like, OK doesn't mean every single handle is thriving β it means the multi stack itself is fine. read the room (and the individual handles) π
π₯ SEE ALSO π₯
curl_multi_cleanup(3)curl_multi_fdset(3)curl_multi_info_read(3)curl_multi_init(3)thehiperfifo.cexample
all of these are linked in spirit, go read them, iykyk π«Ά
lowkey reminder: deprecated β deleted. she's still in the API. but curl_multi_socket_action(3) is the one you actually want. don't make it weird. π
sign-off β this page came to you from libcurl, dated 2026-10-12, and the manual page itself is curl_multi_socket_all(3). that's the footer info, folded in cute-style, bc we don't copy-paste footers in this house π
later bestie, go write some non-blocking code ππ¦β¨
π¦ 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