cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: need example of curl_multi_socket_all

From: maodong hu <hhmmdd_at_gmail.com>
Date: Fri, 27 Jul 2007 17:46:10 +0800

because I use the 7.16.4, it added new interface curl_multi_socket_all and
curl_multi_socket_action, the document said it used to replace
curl_multi_perform and not forced to use select, but I can not find any
examples in the curl-7.16.4.zip that show how to use these two function.

and more over from the document, it said

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.
but I can not make a idea from this describe, so I want a examples to show
me how to use it.

2007/7/27, Daniel Stenberg <daniel_at_haxx.se>:
>
> On Fri, 27 Jul 2007, maodong hu wrote:
>
> > I want make a example for use curl_multi_socket_all, I want commit
> > "GET/POST/PUT" task at anytime, and got result callback, anyone can give
> me
> > a example of usage?
>
> Uh, can you please clarify some more? What's wrong with the existing
> examples
> and docs on how to write such an application? What's your specific
> problems?
>
> Rather than asking us to write a complete example, show us your attempt
> that
> doesn't work and we can help to point out mistakes.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>

-- 
Best Regards
Maodong Hu
Received on 2007-07-27