cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: Values of Running handles

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 29 Nov 2009 19:19:48 +0100 (CET)

On Fri, 27 Nov 2009, centrio_at_gmail.com wrote:

> I am doing simple http Get request and the URL can be finite url or can be a
> streaming URL. I want to know if the connection to the URL is closed.

Do you really? If the connection is closed or not is normally beyond what an
application should care about and libcurl does not expose that info.

libcurl does a transfer and it returns info to the app how the transfer went,
and that's what an app should normally have to care about.

> The connection may be closed if there is some network delay(timeouts) or
> interface down or the server has closed the connection.

If the transfer failed somehow, libcurl returns that info.

> I have only 1 easy handle in multi handle stack. I need to know if
> runningHandles == 0 is criteria to decide closed connection in this case.

runningHandles == 0 means that there is no transfers actively running. It
means that the transfers you started before now have completed. You don't know
if the connection was closed or not.

> I have added the easy handle to the stack in some other portion of the code.
> What are the reasons for transfer to fail?

You use curl_multi_info_read() to figure out how each transfer ends.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-29

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET