Install curl-7.20.0.tar.bz2
[msysgit.git] / mingw / share / man / man3 / curl_multi_fdset.3
bloba6061c2b5fcecea22ff8eba329bd72a863db14b4
1 .\" $Id: curl_multi_fdset.3,v 1.15 2010-01-26 23:02:13 bagder Exp $
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>
10 CURLMcode curl_multi_fdset(CURLM *multi_handle,
11                            fd_set *read_fd_set,
12                            fd_set *write_fd_set,
13                            fd_set *exc_fd_set,
14                            int *max_fd);
15 .ad
16 .SH DESCRIPTION
17 This function extracts file descriptor information from a given multi_handle.
18 libcurl returns its fd_set sets. The application can use these to select() on,
19 but be sure to FD_ZERO them before calling this function as
20 \fIcurl_multi_fdset(3)\fP only adds its own descriptors, it doesn't zero or
21 otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be
22 called as soon as one of them is ready to be read from or written to.
24 To be sure to have up-to-date results, you should call
25 \fIcurl_multi_perform\fP until it does not return CURLM_CALL_MULTI_PERFORM
26 prior to calling \fIcurl_multi_fdset\fP.  This will make sure that libcurl has
27 updated the handles' socket states.
29 If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when
30 this function returns. Otherwise it will contain the higher descriptor number
31 libcurl set.
33 When doing select(), you should use \fBcurl_multi_timeout\fP to figure out how
34 long to wait for action. Call \fIcurl_multi_perform\fP even if no activity has
35 been seen on the fd_sets after the timeout expires as otherwise internal
36 retries and timeouts may not work as you'd think and want.
37 .SH RETURN VALUE
38 CURLMcode type, general libcurl multi interface error code. See
39 \fIlibcurl-errors(3)\fP
40 .SH "SEE ALSO"
41 .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
42 .BR curl_multi_timeout "(3), " curl_multi_perform "(3) "