2
0

curl_multi_info_read.3 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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_info_read 3 "18 Dec 2004" "libcurl 7.10.3" "libcurl Manual"
  23. .SH NAME
  24. curl_multi_info_read - read multi stack informationals
  25. .SH SYNOPSIS
  26. #include <curl/curl.h>
  27. CURLMsg *curl_multi_info_read( CURLM *multi_handle,
  28. int *msgs_in_queue);
  29. .ad
  30. .SH DESCRIPTION
  31. Ask the multi handle if there are any messages/informationals from the
  32. individual transfers. Messages may include informationals such as an error
  33. code from the transfer or just the fact that a transfer is completed. More
  34. details on these should be written down as well.
  35. Repeated calls to this function will return a new struct each time, until a
  36. NULL is returned as a signal that there is no more to get at this point. The
  37. integer pointed to with \fImsgs_in_queue\fP will contain the number of
  38. remaining messages after this function was called.
  39. When you fetch a message using this function, it is removed from the internal
  40. queue so calling this function again will not return the same message
  41. again. It will instead return new messages at each new invoke until the queue
  42. is emptied.
  43. \fBWARNING:\fP The data the returned pointer points to will not survive
  44. calling \fIcurl_multi_cleanup(3)\fP, \fIcurl_multi_remove_handle(3)\fP or
  45. \fIcurl_easy_cleanup(3)\fP.
  46. The 'CURLMsg' struct is very simple and only contains very basic information.
  47. If more involved information is wanted, the particular "easy handle" in
  48. present in that struct and can thus be used in subsequent regular
  49. \fIcurl_easy_getinfo(3)\fP calls (or similar):
  50. .nf
  51. struct CURLMsg {
  52. CURLMSG msg; /* what this message means */
  53. CURL *easy_handle; /* the handle it concerns */
  54. union {
  55. void *whatever; /* message-specific data */
  56. CURLcode result; /* return code for transfer */
  57. } data;
  58. };
  59. .fi
  60. When \fBmsg\fP is \fICURLMSG_DONE\fP, the message identifies a transfer that
  61. is done, and then \fBresult\fP contains the return code for the easy handle
  62. that just completed.
  63. At this point, there are no other \fBmsg\fP types defined.
  64. .SH "RETURN VALUE"
  65. A pointer to a filled-in struct, or NULL if it failed or ran out of
  66. structs. It also writes the number of messages left in the queue (after this
  67. read) in the integer the second argument points to.
  68. .SH "SEE ALSO"
  69. .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " curl_multi_perform "(3)"