cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Fwd: Re: Close callback

From: Ingo Krabbe <ikrabbe.ask_at_web.de>
Date: Thu, 6 Mar 2008 15:16:44 +0100

Am Donnerstag, 6. März 2008 13:29:49 schrieb Daniel Stenberg:
> On Thu, 6 Mar 2008, Ingo Krabbe wrote:
> > With the current state of the library, as I know it, I have to provide a
> > mapping
> >
> > [fd,type] ---> QSocketNotifier (type is read,write or exception)
>
> This description sounds like you want an event-based action, so then you're
> just not using the correct API for this purpose. Try curl_multi_socket():
>
> http://curl.haxx.se/libcurl/c/curl_multi_socket.html
>
> Does this cover what you want?

Something doesn't work now. I now use:

/* do several times for different url's */
        { CURL* curl = curl_easy_init();
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, incoming_list );
        curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, incoming_list );
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, req );
        curl_easy_setopt(curl, CURLOPT_HEADERDATA, req );
        curl_easy_setopt(curl, CURLOPT_NOBODY, 1); /* set a head request */
        curl_easy_setopt(curl, CURLOPT_URL, url );
        return curl; }--->

        curl_multi_add_handle(inf->curl, __C);
/* endof "do several times" */

        curl_multi_setopt( inf->curl, CURLMOPT_SOCKETFUNCTION, curl_socket_cb );
        curl_multi_setopt( inf->curl, CURLMOPT_SOCKETDATA, inf );

But curl_socket_cb never gets called ?!!
Received on 2008-03-06