cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 8 Aug 2013 23:28:48 +0200 (CEST)

On Thu, 8 Aug 2013, Bill Doyle wrote:

Thanks. There's clearly still a distance between where I sit and where you
are. Your description is still filled with references I have a hard time to
figure out...

> I go through the process of a) setting up the GCD queue, and b) the curl
> multi-handle. The queue is pretty easy, just a single call to
> dispatch_queue_create() telling it that I want a serial queue, and then
> creating/attaching the initial timeout to kick everything off. How this
> happens is described a few paragraphs down. (I haven't set a specific timer
> interval here, but that doesn't seem to affect it, so I assume that it
> defaults to not doing anything?

This wording makes me curious. What timer interval are you talking about?

Your event dispatcher should monitor all file descriptors/sockets you've asked
it to monitor and tell you when the timeout is reached. There should be no
timer interval involved!

> It then creates an easy-handle, sets all of the various options on it, and
> adds it to the multi-handle. In particular, the state object (an instance of
> CURLHandleData) is attached using CURLOPT_PRIVATE and also as the userData
> pointer for most of the callbacks. It is also returned to whoever called
> -addUpload:… so that they can use it to track the upload's progress.

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?

> - socket_function sets a keepalive on the sockets, but it doesn't seem
> to have any effect on how things work (or don't).

I think you're talking about TCP keepalive here? I recommend
CURLOPT_TCP_KEEPALIVE and friends instead for that!

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-08-08