curl-library
Re: Sending concurrent requests with single libcurl handle
Date: Wed, 20 Sep 2017 17:08:36 +0530
Hi Daniel,
Thanks it worked for me.
But i have a requirement where after adding easyhandle to multihandle and
doing transfer, then i dont want to call curl_easy_cleanup on that
easyhandle but i want to add same handle again with different url to
multihandle, is that possible?
How can i reuse same easyhandle instead of cleaning it up? I tried to call
curl_easy_reset and then add it back to multihandle with different URL but
its crashing.
Regards,
Vidyanand
On Fri, Sep 8, 2017 at 5:09 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 8 Sep 2017, ViDyAnAnD NiLLe via curl-library wrote:
>
> After going through curl multi interface document, it looks like we can
>> send concurrent request using multiple easy handles in single thread.
>>
>
> Exactly.
>
> I want to simulate async requests the way browser sends.
>>
>> e.g When we hit www.google.com it may send multiple async requests to
>> google.com server to load images, java scripts etc. I want to do similar
>> way with single curl handle, is that possible?
>>
>
> Sure, each transfer you want to do is setup in an easy handle, you add
> those easy handles to the multi handle and off you go.
>
> It can do any number of transfers in parallel and you can add new and
> remove existing transfers at any time.
>
> As per examples given i need to create easy handle for every request and
>> then do multi execute. Can't it be done on single handle?
>>
>
> A single multi handle, yes. Each individual transfer that runs has to be
> setup separately in its own corresponding easy handle.
>
> --
>
> / daniel.haxx.se
>
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-09-20