Git init
[external/curl.git] / docs / libcurl / curl_multi_timeout.3
1 .\"
2 .TH curl_multi_timeout 3 "2 Jan 2006" "libcurl 7.16.0" "libcurl Manual"
3 .SH NAME
4 curl_multi_timeout \- how long to wait for action before proceeding
5 .SH SYNOPSIS
6 #include <curl/curl.h>
7
8 CURLMcode curl_multi_timeout(CURLM *multi_handle, long *timeout);
9 .SH DESCRIPTION
10
11 An application using the libcurl multi interface should call
12 \fBcurl_multi_timeout(3)\fP to figure out how long it should wait for socket
13 actions \- at most \- before proceeding.
14
15 Proceeding means either doing the socket-style timeout action: call the
16 \fBcurl_multi_socket_action(3)\fP function with the \fBsockfd\fP argument set
17 to CURL_SOCKET_TIMEOUT, or call \fBcurl_multi_perform(3)\fP if you're using
18 the simpler and older multi interface approach.
19
20 The timeout value returned in the long \fBtimeout\fP points to, is in number
21 of milliseconds at this very moment. If 0, it means you should proceed
22 immediately without waiting for anything. If it returns -1, there's no timeout
23 at all set.
24
25 An application that uses the multi_socket API SHOULD not use this function, but
26 SHOULD instead use \fIcurl_multi_setopt(3)\fP and its
27 \fPCURLMOPT_TIMERFUNCTION\fP option for proper and desired behavior.
28
29 Note: if libcurl returns a -1 timeout here, it just means that libcurl
30 currently has no stored timeout value. You must not wait too long (more than a
31 few seconds perhaps) before you call curl_multi_perform() again.
32 .SH "RETURN VALUE"
33 The standard CURLMcode for multi interface error codes.
34 .SH "TYPICAL USAGE"
35 Call \fBcurl_multi_timeout(3)\fP, then wait for action on the sockets. You
36 figure out which sockets to wait for by calling \fBcurl_multi_fdset(3)\fP or
37 by a previous call to \fBcurl_multi_socket(3)\fP.
38 .SH AVAILABILITY
39 This function was added in libcurl 7.15.4.
40 .SH "SEE ALSO"
41 .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "
42 .BR curl_multi_socket "(3), " curl_multi_setopt "(3) "
43