[譯]curl_multi_info_read

來源:互聯網
上載者:User

標籤:

curl_multi_info_read - read multi stack informationals
讀取multi stack中的資訊

SYNOPSIS
#include <curl/curl.h>
CURLMsg *curl_multi_info_read( CURLM *multi_handle, int *msgs_in_queue);

DESCRIPTION
Ask the multi handle if there are any messages/informationals from the individual transfers. Messages may include informationals such as an error code from the transfer or just the fact that a transfer is completed. More details on these should be written down as well.
向multi handle查詢單個傳輸的是否有messages/informationals。
messages包括error code或傳輸已完成。

Repeated calls to this function will return a new struct each time, until a NULL is returned as a signal that there is no more to get at this point. The integer pointed to with msgs_in_queue will contain the number of remaining messages after this function was called.
重複調用這個函數,每次會返回一個新的struct,
直到返回NULL時表明當前已經沒有資訊可以擷取了。
第二個參數msgs_in_queue表明經過這次函數調用,還剩下多少訊息。

When you fetch a message using this function, it is removed from the internal queue so calling this function again will not return the same message again. It will instead return new messages at each new invoke until the queue is emptied.
當使用這個函數從內部訊息隊列中取出了一條訊息,則再次調用時不會再取到同樣的訊息。


WARNING: The data the returned pointer points to will not survive calling curl_multi_cleanup, curl_multi_remove_handle or curl_easy_cleanup.
在調用curl_multi_cleanup、curl_multi_remove_handle、curl_easy_cleanup之後,
調用curl_multi_info_read返回的指向資料的指標將不再存在。

The ‘CURLMsg‘ struct is very simple and only contains very basic information. If more involved information is wanted, the particular "easy handle" in present in that struct and can thus be used in subsequent regular curl_easy_getinfo calls (or similar):
CURLMsg只包含了最簡單的資訊,如果需要更多的資訊,
可以使用curl_easy_getinfo函數對CURLMsg結構內的easy_handle取得更多的資訊。

struct CURLMsg {
CURLMSG msg; /* what this message means */
CURL *easy_handle; /* the handle it concerns */
union {
void *whatever; /* message-specific data */
CURLcode result; /* return code for transfer */
} data;
};

When msg is CURLMSG_DONE, the message identifies a transfer that is done, and then result contains the return code for the easy handle that just completed.
當CURLMsg中的CURLMSG msg為CURLMSG_DONE,表明傳輸已經完成,
並且包含完成的easy handle的return code.


At this point, there are no other msg types defined.
除此之外,沒有定義其他訊息類型。

RETURN VALUE
傳回值
A pointer to a filled-in struct, or NULL if it failed or ran out of structs. It also writes the number of messages left in the queue (after this read) in the integer the second argument points to.
一個指向結構體的指標,或者當建立結構體失敗時指標為NULL。
並且第二個參數msgs_in_queue表示內部訊息隊列中剩餘的訊息數。

 

[譯]curl_multi_info_read

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.