cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Can cURL provide non-blocking I/O? And provide me descriptors on which I can "select"?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 17 Feb 2002 16:07:41 +0100 (MET)

On Thu, 14 Feb 2002, William Paris wrote:

(I added the libcurl mailing list to the Cc line, as this is rather a library
issue.)

Hi William!

> I writing a single-threaded program that performs multiple time-critical
> tasks, including retrieving documents over an HTTP connection. Therefore,
> I need a non-blocking HTTP client that gives me access to its socket
> descriptors so I can call "select" on them. Can cURL do this?

Yes and no!

The most tested and used interface to libcurl, the "easy interface", is as
you might have noticed not capable of this.

We do however plan and work on the new "multi interface" that offers exactly
what you're asking for. This interface is already added to libcurl, as of the
most recent versions and there's also a few test applications that use it,
but it isn't announced yet nor documented since we haven't tested it properly
yet (and frankly, I haven't had much time for it).

The interface docs that exist so far, is best found in the multi.h header
file, which can be browsed from the CVS here:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/lib/multi.h?rev=1.5&content-type=text/vnd.viewcvs-markup

Browse my tiny example snippets using this interface here:

 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/multi/

We need a lot more feedback, support and tests before this can be considered
stable.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-02-17