-
code: for(;;){
...
curl_multi_perform(...);
...
mc = curl_multi_poll(m_multi_handle, NULL, 0, 1000, &nums_fds);
if(mc == CURLM_OK && nums_fds >0){
while((handle =curl_multi_info_read(....) )!= null){
int64_t current_time_recv = now;
if (resp->msg == CURLMSG_DONE){
task_queue.push(resp->easy_handle); // find map <CURL*,void* data>,data used callback
}
}
}
.....
}
size_t rest_read_callback(....){
....
int64_t current_time_callback = now; //The callback is called once and the message is received.
....
} Message request interval is 100ms init func: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
code: for(;;){
request_queue.pop(data);
curl_easy_deal...
curl_multi_add_handle(.....);
...
curl_multi_perform(...);
...
mc = curl_multi_poll(m_multi_handle, NULL, 0, 1000, &nums_fds);
if(mc == CURLM_OK && nums_fds >0){
while((handle =curl_multi_info_read(....) )!= null){
int64_t current_time_recv = now;
if (resp->msg == CURLMSG_DONE){
task_queue.push(resp->easy_handle); // find map <CURL*,void* data>,data used callback
curl_multi_remove_handle(...);
}
}
}
.....
}
size_t rest_read_callback(....){
....
int64_t current_time_callback = now; //The callback is called once and the message is received.
....
} Message request interval is 100ms init func: |
Beta Was this translation helpful? Give feedback.
-
I don't understand the question |
Beta Was this translation helpful? Give feedback.
-
Callback timing current_time_callback, and curl_multi_poll interface call timing current_time_recv, the time difference between the two 40ms |
Beta Was this translation helpful? Give feedback.
-
Some of the data is provided by another thread, using a lockless queue, which uses "add perform poll remove" to the same effect.
|
Beta Was this translation helpful? Give feedback.
Some of the data is provided by another thread, using a lockless queue, which uses "add perform poll remove" to the same effect.