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. If
29       an added handle fails very quickly, it may never be counted as  a  run‐
30       ning_handle.
31
32       When running_handles is set to zero (0) on the return of this function,
33       there is no longer any transfers in progress.
34

RETURN VALUE

36       CURLMcode type, general libcurl multi interface error code.
37
38       Before version 7.20.0: If you  receive  CURLM_CALL_MULTI_PERFORM,  this
39       basically  means  that you should call curl_multi_perform again, before
40       you select() on more actions. You don't have to do it immediately,  but
41       the  return  code  means  that  libcurl may have more data available to
42       return or that there may be more data to send off before it is  "satis‐
43       fied".    Do    note    that    curl_multi_perform(3)    will    return
44       CURLM_CALL_MULTI_PERFORM only when it wants to be called again  immedi‐
45       ately.  When  things  are  fine and there is nothing immediate it wants
46       done, it'll return CURLM_OK and you need to wait for "action" and  then
47       call this function again.
48
49       This  function only returns errors etc regarding the whole multi stack.
50       Problems still might have occurred on individual  transfers  even  when
51       this function returns CURLM_OK.
52

TYPICAL USAGE

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

SEE ALSO

60       curl_multi_cleanup(3),     curl_multi_init(3),     curl_multi_fdset(3),
61       curl_multi_info_read(3), libcurl-errors(3)
62
63
64
65libcurl 7.9.5                    1 March 2002            curl_multi_perform(3)
Impressum