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 16:39:30 +0100

Am Donnerstag, 6. März 2008 16:09:17 schrieb Ingo Krabbe:
> Am Donnerstag, 6. März 2008 15:52:46 schrieb Daniel Stenberg:
> > On Thu, 6 Mar 2008, Ingo Krabbe wrote:
> > > /* 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 ?!!
> >
> > There's no curl_multi_socket_all() or similar called?
>
> I use curl_multi_perform for that ... sorry I forgot.
>
> Do I have to use curlt_multi_socket_all() ?
>
> Thats what I do:
>
> while ( CURLM_CALL_MULTI_PERFORM ==
> (curl_multi_perform(inf->curl, &inf->handles)) );

Ok it works now by calling
while ( CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(inf->curl,
                                  &inf->handles));

nice.

But: I would think you would call like this:

CURL_POLL_NONE
CURL_POLL_OUT
CURL_POLL_IN
CURL_POLL_REMOVE

But you do
CURL_POLL_OUT
CURL_POLL_REMOVE
CURL_POLL_IN
CURL_POLL_REMOVE

thats a bit strange but works too of course.
Received on 2008-03-06