cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: check internet connection with curl

From: Meir Yanovich <meiry242_at_gmail.com>
Date: Thu, 24 Apr 2008 22:09:40 +0200

not so simple
i don't want to show to the user any error , the program itself needs
to do its best
to recover when connection to the internet is loss
there will be endless loop that will preform this checking every N seconds / min
so now i trying to figure it what will be the best way to preform this check

On Thu, Apr 24, 2008 at 9:55 PM, Alan Wolfe <alan.wolfe_at_gmail.com> wrote:
> well here's an idea, you are using curl to make some kind of http
> operations to some server right?
>
> You don't care so much that a person doesn't have internet, what you
> really care about is whether or not you can reach that host right?
>
> So what about this...
>
> *Try to send a request to your target server, if it fails, report
> connection problems to the user.
>
> If i'm right about you're program, that's much simpler than this...
>
> *check for internet connection and if no connection found, show an
> error to the user
> *make a request of the target server, and if it fails, show an error to the user
>
> seems to me you can simplify the process by just contacting your
> server but i could be misinterpreting what you are trying to do.
>
>
>
>
> On 4/24/08, Meir Yanovich <meiry242_at_gmail.com> wrote:
> > no problem i guess .
> > you mean just to make simple http post operation ?
> > what will be the lightest curl operation to do , to determine if there
> > is internet connection ?
> >
> > On Thu, Apr 24, 2008 at 6:50 PM, Gary Maxwell <gmaxwell_at_casabi.com> wrote:
> > > Meir Yanovich wrote:
> > > >
> > > > thanks for the explanation about pings.
> > > > what about doing ping to one major site like google.com
> > > > and according to the result determine if im online or not .
> > > > the reason i need this check is that the client need to preform his
> > > > best guess when there is
> > > > internet connection after loosing connection .
> > > >
> > > And performing a curl operation isn't good enough to determine if you
> > > have a good connection? Why not?
> > >
> > > Once again, ping is unreliable for what you want. The ping may fail even
> > > if your connection is fine.
> > >
> > > -Gary
> > >
> >
>
Received on 2008-04-24