Manpage for curl_multi_wait().
[platform/upstream/curl.git] / docs / libcurl / curl_multi_wait.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_multi_wait 3 "12 Jul 2012" "libcurl 7.28.0" "libcurl Manual"
23 .SH NAME
24 curl_multi_select - polls on all easy handles in a multi handle
25 .SH SYNOPSIS
26 .nf
27 #include <curl/curl.h>
28
29 CURLMcode curl_multi_wait(CURLM *multi_handle,
30                           struct curl_waitfd extra_fds[],
31                           unsigned int extra_nfds,
32                           int timeout_ms);
33 .ad
34 .SH DESCRIPTION
35 This function polls on all file descriptors used by the curl easy handles
36 contained in the given multi handle set.  It will block until activity is
37 detected on at least one of the handles or \fItimeout_ms\fP has passed.
38
39 The calling application may pass additional curl_waitfd structures which are
40 similar to \fIpoll(2)\fP's pollfd structure to be waited on in the same call.
41
42 This function is encouraged to be used instead of select(3) when using the
43 multi interface to allow applications to easier circumvent the common problem
44 with 1024 maximum file descriptors.
45 .SH curl_waitfd
46 .nf
47 struct curl_waitfd {
48   curl_socket_t fd;
49   short events;
50   short revents;
51 };
52 .fi
53 .IP CURL_WAIT_POLLIN
54 Bit flag to curl_waitfd.events indicating the socket should poll on read
55 events such as new data received.
56 .IP CURL_WAIT_POLLPRI
57 Bit flag to curl_waitfd.events indicating the socket should poll on high
58 priority read events such as out of band data.
59 .IP CURL_WAIT_POLLOUT
60 Bit flag to curl_waitfd.events indicating the socket should poll on write
61 events such as the socket being clear to write without blocking.
62 .SH RETURN VALUE
63 CURLMcode type, general libcurl multi interface error code. See
64 \fIlibcurl-errors(3)\fP
65 .SH AVAILABILITY
66 This function was added in libcurl 7.28.0
67 .SH "SEE ALSO"
68 .BR curl_multi_fdset "(3), " curl_multi_perform "(3)"