cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: connection status

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

Hi Barry...

It is the last socket that was closed, but kept in the cache for future use
on this handle. I don't know much about the ftp code, so I can't say what it
was used for. Take a look at the CVS code and see if it does what you need.

I added the feature for use with CURLOPT_CONNECT_ONLY. But perhaps its use
with ftp needs more thought. Now is the time to look at it because the code
has not been released (so the paint is still wet).

HTH,

...Karl

>From: "Barry Baker"
>Subject: Re: connection status
>Date: Sat, 25 Feb 2006 14:04:37 -0500
>
>thanks...
>do you know what is meant by "last socket used by this curl session" in the
>context of persistent connections to ftp servers where there is always a
>command socket open and other sockets are opened to perform the actual data
>transfers? Does "last socket" refer to the last data socket or does it
>refer to the control socket?
>
>thanks again,
>-barry
>
>On 2/25/06, Karl M <karlm30_at_hotmail.com> wrote:
> >
> > 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