1curl_multi_perform(3) libcurl Manual curl_multi_perform(3)
2
3
4
6 curl_multi_perform - reads/writes available data from each easy handle
7
9 #include <curl/curl.h>
10
11 CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_han‐
12 dles);
13
15 When the app thinks there's data available for the multi_handle, it
16 should call this function to read/write whatever there is to read or
17 write right now. curl_multi_perform() returns as soon as the
18 reads/writes are done. This function does not require that there actu‐
19 ally is any data available for reading or that data can be written, it
20 can be called just in case. It will write the number of handles that
21 still transfer data in the second argument's integer-pointer.
22
23 When you call curl_multi_perform() and the amount of running_handles is
24 changed from the previous call (or is less than the amount of easy han‐
25 dles you've added to the multi handle), you know that there is one or
26 more transfers less "running". You can then call
27 curl_multi_info_read(3) to get information about each individual com‐
28 pleted transfer, and that returned info includes CURLcode and more.
29
30 When running_handles is set to zero (0) on the return of this function,
31 there is no longer any transfers in progress.
32
34 CURLMcode type, general libcurl multi interface error code.
35
36 If you receive CURLM_CALL_MULTI_PERFORM, this basically means that you
37 should call curl_multi_perform again, before you select() on more
38 actions. You don't have to do it immediately, but the return code means
39 that libcurl may have more data available to return or that there may
40 be more data to send off before it is "satisfied". Do note that
41 curl_multi_perform(3) will return CURLM_CALL_MULTI_PERFORM only when it
42 wants to be called again immediately. When things are fine and there is
43 nothing immediate it wants done, it'll return CURLM_OK and you need to
44 wait for "action" and then call this function again.
45
46 NOTE that this only returns errors etc regarding the whole multi stack.
47 Problems still might have occurred on individual transfers even when
48 this function returns CURLM_OK.
49
51 Most applications will use curl_multi_fdset(3) to get the multi_han‐
52 dle's file descriptors, then it'll wait for action on them using
53 select(3) and as soon as one or more of them are ready, curl_multi_per‐
54 form(3) gets called.
55
57 curl_multi_cleanup(3), curl_multi_init(3), curl_multi_fdset(3),
58 curl_multi_info_read(3), libcurl-errors(3)
59
60
61
62libcurl 7.9.5 1 March 2002 curl_multi_perform(3)