X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Flibcurl%2Fcurl_multi_timeout.3;h=f0c90796602666818bb479abfc0e2a746de1b284;hb=8a08705db260779441360e959b97b6c172f8acb0;hp=e18b935ccc34f4b2eee3c4f231ba267ae0b0add4;hpb=f7bbc1c9b6a8e2c815d09612b53f453c90d962e0;p=platform%2Fupstream%2Fcurl.git diff --git a/docs/libcurl/curl_multi_timeout.3 b/docs/libcurl/curl_multi_timeout.3 index e18b935..f0c9079 100644 --- a/docs/libcurl/curl_multi_timeout.3 +++ b/docs/libcurl/curl_multi_timeout.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -49,6 +49,22 @@ SHOULD instead use \fIcurl_multi_setopt(3)\fP and its Note: if libcurl returns a -1 timeout here, it just means that libcurl currently has no stored timeout value. You must not wait too long (more than a few seconds perhaps) before you call curl_multi_perform() again. +.SH EXAMPLE +.nf +struct timeval timeout; +long timeo; + +curl_multi_timeout(multi_handle, &timeo); +if(timeo < 0) + /* no set timeout, use a default */ + timeo = 980; + +timeout.tv_sec = timeo / 1000; +timeout.tv_usec = (timeo % 1000) * 1000; + +/* wait for activities no longer than the set timeout */ +select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); +.fi .SH "RETURN VALUE" The standard CURLMcode for multi interface error codes. .SH "TYPICAL USAGE"