cURL / Mailing Lists / curl-library / Single Mail


Re: async IO using libCURL

From: Daniel Stenberg <>
Date: Wed, 11 Aug 2010 19:15:20 +0200 (CEST)

On Wed, 11 Aug 2010, Isaac Jurado wrote:

> I've been reviewing the libcurl multi functions several times and I'm unable
> to grasp how I could integrate CURL with my custom event loop. The main
> obstacle is how to obtain the socket descriptor from a CURL easy handle.

You need to use the multi_socket API. It is designed to export the sockets
libcurl use and to allow you to do all the event and socket handling.


> Having a CURLMOPT_SOCKETFUNCTION does not seem to solve the problem as it is
> only invoked with curl_multi_socket_action, where you already need to know
> the descriptor.

No, you can also call it as a timeout (see the man page for details on how),
which you can/should do as a first call to get it going the first time.

List admin:
Received on 2010-08-11