cURL / Mailing Lists / curl-library / Single Mail


Re: Multi-handle hanging up immediately after creating FTP data socket (using GCD)

From: Daniel Stenberg <>
Date: Fri, 9 Aug 2013 23:48:02 +0200 (CEST)

On Fri, 9 Aug 2013, Bill Doyle wrote:

> Alright, this might be one of the points that's causing me trouble
> then. So when the CURLMOPT_TIMERFUNCTION is told to set a timeout, is
> it always supposed to be a one-time thing?

Yes. It is always one single (active) timer and it is always single-shot. If
you get a new timeout callback (before or after the existing one expires),
that's the new time to set for the timer.

>> Okay so after you've called curl_multi_add_handle() to add that brand new
>> easy handle to the multi handle, what libcurl function do you call then? If
>> you don't explicitly call a function, you then just call one when the next
>> action happens?
> I'm not calling anything after adding the handle. Should I be?

Sorry, I was a bit rusty with the specific details but I read up on the source
code and I also just updated the curl_multi_add_handle() man page to clarify:
when you add a new handle it will cause the timer callback to get called with
the updated timeout timer (1ms) so when that expires you'll of course call
curl_multi_socket_action() on that handle and then it is kicked off. You
should of course be able to see this.

Depending on what name resolver backend you use, you should get some timeout
set after the 1ms timeout but then there's no other default timeout if I
remember correctly and it should only be doing socket callbacks to alter what
you should wait for.

List admin:
Received on 2013-08-09