cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How do you know when the read/write callbacks are done and transfer is complete?

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Fri, 22 Jan 2010 01:32:25 -0600

On Thu, Jan 21, 2010 at 12:18 PM, vick <vijayx_at_gmail.com> wrote:

> Its the multi scenario that interests me.
> i havent seen any good examples of how this can be done with curl.

Have a look at curl/docs/examples/hiperfifo.c it should give you some
idea of where to start.

> Maybe if the user was allowed to associate a "user data" in the callback

The last argument passed in to your read/write callbacks is the same
pointer you can set with CURLOPT_READDATA/CURLOPT_WRITEDATA.
If you use the builtin callbacks it must be a FILE pointer, but if you are
using your own callbacks, it can be a pointer to any type of data structure
you choose.

If you need a more general way to associate something to a specific
handle, have a look at CURLOPT_PRIVATE and CURLINFO_PRIVATE.

> Also, can you use thread pools with curl?

Not sure exactly what you mean here.

 - Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-22