thanks for replying.
before the first time callback function called ,at this time,we do not know the 
timeout time,right? so how could value timeout changed,and how could callback 
function called?


In the example file hiperfifo.c , the first time callback function 
"timer_cb"called,and in that callback function ,we know the value of timeout_ms 
 is 1ms,before this callback function called ,we did not know this value ,right?
so I am so confused about the prerequisite of this callback function ?
best wishes
knuth





At 2015-01-06 06:04:37, "Daniel Stenberg" <[email protected]> wrote:
>On Mon, 5 Jan 2015, 兰天 wrote:
>
>> CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_TIMERFUNCTION, 
>> timer_callback);
>>
>> and I know that when the timeout changed,the callback function are called, 
>> however,the first time we register the callback function ,for example:
>>
>> curl_multi_setopt(handle, CURLMOPT_TIMERFUNCTION, timer_cb);
>> and the callback function is 
>> int timer_cb(CURLM *multi, long timeout_ms,void *userp)
>> {
>> ......
>> }
>
>> the second paramenter timeout_ms value is ?.
>
>
>Well, before the callback is ever called, the argument of course hasn't gotten 
>any value.
>
>> I read the docs/example hiperfifo.c ,and I see the log ,this value is 
>> 1ms,how did this value come?
>
>In many cases, the first timeout that the callback will be told about is 1ms 
>into the future.
>
>-- 
>
>  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to