cURL / Mailing Lists / curl-library / Single Mail

curl-library

Socket interface/curl_multi_socket_all()

From: Manuel Jung <gzahl_at_arcor.de>
Date: Wed, 16 May 2007 18:55:54 +0200

Hi,
Im using the "_perform" interface right now and want to change to the new,
faster design, but i have some questions.
The loop is defined like this in the docs:

1. Create a multi handle

2. Set the socket callback with CURLMOPT_SOCKETFUNCTION

3. Add easy handles

4. Call curl_multi_socket_all() first once

5. Setup a "collection" of sockets to supervise when your socket callback is
called.

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

7. Wait for action on any of libcurl's sockets

8, When action happens, call curl_multi_socket_action() for the socket(s) that
got action.

9. Go back to step 6.

I can add new easy_handles at between step 6 and 9? Is that right? 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?
There is no example with the curl_multi_socket_action() in the 7.16.2 release,
is there? I just found the examples ghiper.c and hiperpipe.c (filenames write
like they are on my mind..).
Kind Regards
Manuel Jung
Received on 2007-05-16