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

NAME

6       curl_multi_fdset  -  extracts  file descriptor information from a multi
7       handle
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLMcode curl_multi_fdset(CURLM *multi_handle,
13                                  fd_set *read_fd_set,
14                                  fd_set *write_fd_set,
15                                  fd_set *exc_fd_set,
16                                  int *max_fd);
17

DESCRIPTION

19       This  function  extracts  file  descriptor  information  from  a  given
20       multi_handle.  libcurl returns its fd_set sets. The application can use
21       these to select() on, but be sure to FD_ZERO them before  calling  this
22       function  as  curl_multi_fdset(3)  only  adds  its  own descriptors, it
23       doesn't zero or otherwise remove any others. The  curl_multi_perform(3)
24       function  should  be  called as soon as one of them is ready to be read
25       from or written to.
26
27       To be sure to have up-to-date results, you should call  curl_multi_per‐
28       form until it does not return CURLM_CALL_MULTI_PERFORM prior to calling
29       curl_multi_fdset.  This will make sure that  libcurl  has  updated  the
30       handles' socket states.
31
32       If  no file descriptors are set by libcurl, max_fd will contain -1 when
33       this function returns. Otherwise it will contain the higher  descriptor
34       number libcurl set.
35
36       When  doing  select(),  you should use curl_multi_timeout to figure out
37       how long to wait for action. Call curl_multi_perform even if no  activ‐
38       ity has been seen on the fd_sets after the timeout expires as otherwise
39       internal retries and timeouts may not work as you'd think and want.
40

RETURN VALUE

42       CURLMcode  type,  general  libcurl  multi  interface  error  code.  See
43       libcurl-errors(3)
44

SEE ALSO

46       curl_multi_cleanup(3),    curl_multi_init(3),    curl_multi_timeout(3),
47       curl_multi_perform(3)
48
49
50
51libcurl 7.16.0                    2 Jan 2006               curl_multi_fdset(3)
Impressum