Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
curl_multi_timeout(3) | Library Functions Manual | curl_multi_timeout(3) |
NAME
curl_multi_timeout - how long to wait for action before proceedingDESCRIPTION
An application using the libcurl multi interface should call curl_multi_timeout(3) to figure out how long it should wait for socket actions - at most - before proceeding.PROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
struct timeval timeout;
long timeo;
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
CURLM *multi = curl_multi_init();
curl_multi_timeout(multi, &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);
}
TYPICAL USAGE
Call curl_multi_timeout(3), then wait for action on the sockets. Figure out which sockets to wait for by calling curl_multi_fdset(3).AVAILABILITY
Added in curl 7.15.4RETURN VALUE
The standard CURLMcode for multi interface error codes.SEE ALSO
curl_multi_fdset(3), curl_multi_info_read(3), curl_multi_setopt(3), curl_multi_socket(3)2024-11-23 | libcurl |