cURL / Mailing Lists / curl-library / Single Mail

curl-library

help:regarding async

From: Honne Gowda A <honne_gowda_at_yahoo.com>
Date: Tue, 8 Aug 2006 03:46:07 -0700 (PDT)

Hi,
I am trying here to use libcurl in async fashion.
This is how I am doing:

init()
{
    I will create a global multi handle here;
}

fetchpage(url)
{
    create an easyhandle;
    add this easy handle to multi-handle;
    ec = curl_easy_setopt(easyhandle,
CURLOPT_WRITEFUNCTION, writecb);
 ec = curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA,
(void *)ca);
    say multi_perform();
    get the fd set from multi-handle and add to the
select()

}

There is an draw-back here,
Take note that libcurl does also feature some time-out
code so we advice you to never use very long timeouts
on select() before you call curl_multi_perform(3),
which thus should be called unconditionally every now
and then even if none of its file descriptors have
signaled ready.

From above paragraph, I simply can not depend on
select(). Every now and then I have to call
multi_perfrom() periodically.

The proble I am facing here is:

fetchpage() can called by another module and here I
have call him(by some kind of call-back given to me)
once the data transfer is complete for that url.

Please let me know how can I achive this.

TIA,
-honne

below statement is false.
above statement is true.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on 2006-08-08