Testing if there is an Internet Connection

Andre Garzia andre at andregarzia.com
Sat Dec 1 09:05:01 EST 2007


Aloha Folks,

I use the following approach. I open a socket to my server, if it
opens, I request an HTTP HEAD from it and inspect the result.

all I need is to have a clear path to my server.

Many general purpose solutions that rely on DNS or Broadcast packets
may fail if the user has a home network or intranet where it really
appears that he is on the internet but he's only on a LAN. Some
friends even run their own DNS servers and have domains setup on their
lan... detecting internet may become hard on those extreme scenarios,
so instead of detecting the internet, try detecting your server, much
easier.

Andre

On 12/1/07, Sivakatirswami <katir at hindu.org> wrote:
> Dave wrote:
> > Hi all,
> >
> > Is there a way to test if the machine you are running on currently
> > connected to the Internet?
> >
> > Thanks a lot
> > All the Best
> > Dave
>
> I use a "baby face" method where the goal is to be
> sure they are talking to our own servers
>
> put a file your web site:
>
> ping.txt
>
> put the word "true" into that file
>
> then it is as simple as :
>
> on testConnection
>    if not ((url "http://www.himalayanacademy.com/ping.txt")= "true") then
>         answer "Please log in to the internet and try again." with "OK"
>   end if
> end testConnection
>
>
> I see a lot of "macho" solutions but I never understood, at least in our
> context (wanting to be sure our users can access our servers) why  there
> is any need for more than this.
>
>
>
>
>
>
>
>
> >
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list