> > As I wrote earlier, usually when you call curl_multi_add_handle(), the > Timer > > Function CB is called once by curl with timeout set to 0. Then when you > call > > curl_multi_socket_action() with CURL_SOCKET_TIMEOUT the Timer Function > CB is > > usually called once ...
you call curl_multi_socket_action() with CURL_SOCKET_TIMEOUT the Timer Function CB is usually called once more but this time with a timeout set to 1. If you do not call curl_multi_socket_action() again with CURL_SOCKET_TIMEOUT after 1ms then curl stalls indefinitely since there will b...
If you do not call curl_multi_socket_action() again with CURL_SOCKET_TIMEOUTafter 1ms then curl stalls indefinitely since there will be no read or writeevents triggering the event handler to return events, ... because in that scenario libcurl waits to get called so that it can pollif the...
curl_multi_socket_action() with CURL_SOCKET_TIMEOUT, isn't that what I'm supposed to do when the callback tells me that the timeout is 1ms? And this particular run with 1ms did not lead to 100% cpu, it was when curl gave me 0ms as timeout as the last timeout which lead me ...
curl_multi_socket_action (curlm, CURL_SOCKET_TIMEOUT, 0, &running_handles); } else if (ret != -1) { /* events */ if (fds[0].revents != 0) curl_multi_socket_action (curlm, fds[0].fd, fds[0].revents, &running_handles); ...
call curl_multi_socket_action() after each event handler return (and I assume here without checking that curl_multi_socket_action() is a much heavier function to call than curl_multi_timeout(), but I could of course be wrong), or one have to track the time taken during the event hand...
> curl_multi_socket_action() with CURL_SOCKET_TIMEOUT the Timer Function CB is > usually called once more but this time with a timeout set to 1. This description matches how libcurl *did* behave. More recent versions don't need to poll the name resolve results from the threaded resolver...
And this particular run with 1ms did not lead to 100% cpu, it was when curlgave me 0ms as timeout as the last timeout which lead me to callcurl_multi_socket_action() every 0ms, which turned it into a busy wait loopand hence the 100% cpu. Shouldn't curl return -1 as infinte...
> I also mix curl-socket with multiple other classes of sockets and do no > call call curl_multi_timeout() at each iteration. > > In my sample the eventloop call 'glueOnSocketCB' as soon as a curlsocket > is readable. 'glueOnSocketCB' map mainloop event-names to curl-events ...
curl_multi_socket_action() each time epoll returns which I guess would be quite some overhead? I'm not really arguing anything here more than pointing out that curl_multi_timeout() have it's place even in the multi socket API :) ...