cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: connection status

From: Karl M <karlm30_at_hotmail.com>
Date: Sat, 25 Feb 2006 10:42:34 -0800

Hi Barry...

I don't understand your requirement exactly, but perhaps you could use
curl_easy_getinfo with the new CURLINFO_LASTSOCKET option and check the
status of the socket in your application.

HTH,

...Karl

>From: "Barry Baker" Subject: Re: connection status
>Date: Sat, 25 Feb 2006 10:49:17 -0500
>
>The system that I am incorporating this on has restrictions against long
>running processes, so to implement our command line interface with
>persistent connections we are looking for a way to detect server timeout.
>
>Yeah, I agree that my current approach of trying to get some sort of status
>information about the underlying control socekt connection through the use
>of the multi interface to get the socket and then use select/read leaves
>the
>socket in a bad state from an ssl context perspective.
>
>So my question was really a general one about any available interface that
>can be used to determine if a persistent connection being used by a handle
>can has been shut down (maybe a curl_easy_getinfo option that does
>something
>like a getsockopt() on the control socket to see if it is still available).
>
>thanks for your time,
>-barry
>
>On 2/25/06, Daniel Stenberg <daniel_at_haxx.se> wrote:
> >
> > On Fri, 24 Feb 2006, Barry Baker wrote:
> >
> > > Well, I'm not sure I understand how this is "not a libcurl topic" just
> > > because you dont understand my usage of libcurl.
> >
> > I thought your problems are because you're _not_ using libcurl but try
>to
> > figure out things under the hood on your own. But clearly I can be
>wrong.
> >
> > > I'd prefer not to come up with an arbitrary timeout mechanism for
> > persistent
> > > connections, and would rather rely on the mechanism that already
>exists
> > in
> > > FTP servers. If any other users out there have tried to do similar
> > things,
> > > I'd be interested in hearing from them versus "dropping" my initial
> > question
> >
> > I certainly don't prevent anyone from answering, but then I also asked
>you
> > several questions about why you do this the way you do and what you can
> > possibly gain from it. I guess that if I understood your use case
>better,
> > I
> > could possibly provide a (better) answer.
> >
> > But of course this just *me* and my views. Anyone else can always
>respond
> > and
> > perhaps everyone else on this list already understood you fine.
> >
> > --
> > Commercial curl and libcurl Technical Support:
>http://haxx.se/curl.html
> >
Received on 2006-02-25