1curl_multi_perform(3)           libcurl Manual           curl_multi_perform(3)
2
3
4

NAME

6       curl_multi_perform - reads/writes available data from each easy handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLMcode  curl_multi_perform(CURLM  *multi_handle,  int  *running_han‐
12       dles);
13

DESCRIPTION

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

RETURN VALUE

31       CURLMcode type, general libcurl multi interface error code.
32
33       If  you receive CURLM_CALL_MULTI_PERFORM, this basically means that you
34       should call curl_multi_perform  again,  before  you  select()  on  more
35       actions. You don't have to do it immediately, but the return code means
36       that libcurl may have more data available to return or that  there  may
37       be  more  data  to  send  off  before  it  is "satisfied". Do note that
38       curl_multi_perform(3) will return CURLM_CALL_MULTI_PERFORM only when it
39       wants  to  be  called again immediately. When things are fine and there
40       are nothing immediate it wants done, it'll return CURLM_OK and you need
41       to wait for "action" and then call this function again.
42
43       NOTE that this only returns errors etc regarding the whole multi stack.
44       There might still have occurred problems on individual  transfers  even
45       when this function returns CURLM_OK.
46

TYPICAL USAGE

48       Most  applications  will  use curl_multi_fdset(3) to get the multi_han‐
49       dle's file descriptors, then  it'll  wait  for  action  on  them  using
50       select(3) and as soon as one or more of them are ready, curl_multi_per‐
51       form(3) gets called.
52

SEE ALSO

54       curl_multi_cleanup(3),     curl_multi_init(3),     curl_multi_fdset(3),
55       curl_multi_info_read(3), libcurl-errors(3)
56
57
58
59libcurl 7.9.5                    1 March 2002            curl_multi_perform(3)
Impressum