curl_multi_perform.3 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" $Id$
  2. .\"
  3. .TH curl_multi_perform 3 "1 March 2002" "libcurl 7.9.5" "libcurl Manual"
  4. .SH NAME
  5. curl_multi_perform - reads/writes available data from each easy handle
  6. .SH SYNOPSIS
  7. #include <curl/curl.h>
  8. CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles);
  9. .ad
  10. .SH DESCRIPTION
  11. When the app thinks there's data available for the multi_handle, it should
  12. call this function to read/write whatever there is to read or write right
  13. now. curl_multi_perform() returns as soon as the reads/writes are done. This
  14. function does not require that there actually is any data available for
  15. reading or that data can be written, it can be called just in case. It will
  16. write the number of handles that still transfer data in the second argument's
  17. integer-pointer.
  18. When you call curl_multi_perform() and the amount of \fIrunning_handles\fP is
  19. changed from the previous call (or is less than the amount of easy handles
  20. you've added to the multi handle), you know that there is one or more
  21. transfers less "running". You can then call \fIcurl_multi_info_read(3)\fP to
  22. get information about each individual completed transfer, and that returned
  23. info includes CURLcode and more.
  24. .SH "RETURN VALUE"
  25. CURLMcode type, general libcurl multi interface error code.
  26. If you receive \fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you
  27. should call \fIcurl_multi_perform\fP again, before you select() on more
  28. actions. You don't have to do it immediately, but the return code means that
  29. libcurl may have more data available to return or that there may be more data
  30. to send off before it is "satisfied". Do note that \fIcurl_multi_perform(3)\fP
  31. will return \fICURLM_CALL_MULTI_PERFORM\fP only when it wants to be called
  32. again \fBimmediately\fP. When things are fine and there is nothing immediate
  33. it wants done, it'll return \fICURLM_OK\fP and you need to wait for \&"action"
  34. and then call this function again.
  35. NOTE that this only returns errors etc regarding the whole multi stack. Problems
  36. still might have occurred on individual transfers even when this
  37. function returns \fICURLM_OK\fP.
  38. .SH "TYPICAL USAGE"
  39. Most applications will use \fIcurl_multi_fdset(3)\fP to get the multi_handle's
  40. file descriptors, then it'll wait for action on them using \fBselect(3)\fP and
  41. as soon as one or more of them are ready, \fIcurl_multi_perform(3)\fP gets
  42. called.
  43. .SH "SEE ALSO"
  44. .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
  45. .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "
  46. .BR libcurl-errors "(3)"