cURL / Mailing Lists / curl-library / Single Mail


Re: Closing an open connection with curl easy handle

From: Daniel Stenberg <>
Date: Mon, 3 Oct 2011 22:53:55 +0200 (CEST)

On Mon, 3 Oct 2011, Thibaut Le Guilly wrote:

>> Why is curl_multi_perform() a bigger problem than calling
>> curl_easy_perform() ?
> Because (unless I'm doing something wrong or misunderstood)
> curl_easy_perform is synchronous and will call the write callback each time
> the server sends notification, while curl_multi_perform is asynchronous and
> needs to be called each time I want to check for notifications, and for the
> write callback to be called (at least that's what I experienced). Is that
> right?

That's correct, yes.

> Or is there a way with the multi interface that would also call the write
> callback as soon as a notification is received, without explicitly calling
> curl_multi_perform?

You of course need to monitor if something happens on the connection in order
to know if something is sent from the server. If you use the normal multi
interface that means you run select() on the fd_set sockets libcurl has told
you about. If you then see that you got something to act on, you call libcurl.

List admin:
Received on 2011-10-03