cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Socket interface/curl_multi_socket_all()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 May 2007 16:50:28 +0200 (CEST)

On Wed, 16 May 2007, Manuel Jung wrote:

> 6. Use curl_multi_timeout() to figure out how long to wait for action

Nah, for the socket API we now recommend the CURLMOPT_TIMOUTFUNCTION callback
that gets called when the timeout time changes. Otherwise your code will turn
out ugly since you (as in the app) can't really know when the timeout changes
as it might change on just about any call to libcurl.

> I can add new easy_handles at between step 6 and 9? Is that right?

Yes.

> If all downloads were done, but later ill have todo some again, can i still
> stay in the 6 to 9 loop or do i have to call curl_multi_socket_all() first,
> and go then back in the loop?

Well, ignoring the fact that we've fixed a bug with this in 7.16.2 and
earlier, you would not need to "go back" to *_socket_all().
curl_multi_socket_all() remains a clever thing to call if you add multiple
handles at once and want them taken care of as soon as possible.

> There is no example with the curl_multi_socket_action() in the 7.16.2
> release, is there?

No, since curl_multi_socket_action() was added after that release!!

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-05-17