curl_multi_timeout.3 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2011, 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_timeout 3 "2 Jan 2006" "libcurl 7.16.0" "libcurl Manual"
  23. .SH NAME
  24. curl_multi_timeout \- how long to wait for action before proceeding
  25. .SH SYNOPSIS
  26. #include <curl/curl.h>
  27. CURLMcode curl_multi_timeout(CURLM *multi_handle, long *timeout);
  28. .SH DESCRIPTION
  29. An application using the libcurl multi interface should call
  30. \fBcurl_multi_timeout(3)\fP to figure out how long it should wait for socket
  31. actions \- at most \- before proceeding.
  32. Proceeding means either doing the socket-style timeout action: call the
  33. \fBcurl_multi_socket_action(3)\fP function with the \fBsockfd\fP argument set
  34. to CURL_SOCKET_TIMEOUT, or call \fBcurl_multi_perform(3)\fP if you're using
  35. the simpler and older multi interface approach.
  36. The timeout value returned in the long \fBtimeout\fP points to, is in number
  37. of milliseconds at this very moment. If 0, it means you should proceed
  38. immediately without waiting for anything. If it returns -1, there's no timeout
  39. at all set.
  40. An application that uses the multi_socket API SHOULD not use this function, but
  41. SHOULD instead use \fIcurl_multi_setopt(3)\fP and its
  42. \fPCURLMOPT_TIMERFUNCTION\fP option for proper and desired behavior.
  43. Note: if libcurl returns a -1 timeout here, it just means that libcurl
  44. currently has no stored timeout value. You must not wait too long (more than a
  45. few seconds perhaps) before you call curl_multi_perform() again.
  46. .SH "RETURN VALUE"
  47. The standard CURLMcode for multi interface error codes.
  48. .SH "TYPICAL USAGE"
  49. Call \fBcurl_multi_timeout(3)\fP, then wait for action on the sockets. You
  50. figure out which sockets to wait for by calling \fBcurl_multi_fdset(3)\fP or
  51. by a previous call to \fBcurl_multi_socket(3)\fP.
  52. .SH AVAILABILITY
  53. This function was added in libcurl 7.15.4.
  54. .SH "SEE ALSO"
  55. .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "
  56. .BR curl_multi_socket "(3), " curl_multi_setopt "(3) "