curl_multi_fdset.3 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .\" $Id$
  2. .\"
  3. .TH curl_multi_fdset 3 "2 Jan 2006" "libcurl 7.16.0" "libcurl Manual"
  4. .SH NAME
  5. curl_multi_fdset - extracts file descriptor information from a multi handle
  6. .SH SYNOPSIS
  7. .nf
  8. #include <curl/curl.h>
  9. CURLMcode curl_multi_fdset(CURLM *multi_handle,
  10. fd_set *read_fd_set,
  11. fd_set *write_fd_set,
  12. fd_set *exc_fd_set,
  13. int *max_fd);
  14. .ad
  15. .SH DESCRIPTION
  16. This function extracts file descriptor information from a given multi_handle.
  17. libcurl returns its fd_set sets. The application can use these to select() on,
  18. but be sure to FD_ZERO them before calling this function as
  19. \fIcurl_multi_fdset(3)\fP only adds its own descriptors, it doesn't zero or
  20. otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be
  21. called as soon as one of them is ready to be read from or written to.
  22. If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when
  23. this function returns. Otherwise it will contain the higher descriptor number
  24. libcurl set.
  25. You should also be aware that when doing select(), you should consider using a
  26. rather small (single-digit number of seconds) timeout and call
  27. \fIcurl_multi_perform\fP regularly - even if no activity has been seen on the
  28. fd_sets - as otherwise libcurl-internal retries and timeouts may not work as
  29. you'd think and want.
  30. Starting with libcurl 7.16.0, you should use \fBcurl_multi_timeout\fP to
  31. figure out how long to wait for action.
  32. .SH RETURN VALUE
  33. CURLMcode type, general libcurl multi interface error code. See
  34. \fIlibcurl-errors(3)\fP
  35. .SH "SEE ALSO"
  36. .BR curl_multi_cleanup "(3)," curl_multi_init "(3), "
  37. .BR curl_multi_timeout "(3) "