Re: How do i check for an internet connection?

2005-12-11 Thread Dave Cragg


On 11 Dec 2005, at 00:50, Alex Tweedly wrote:


Jerry Daniels wrote:


Kurt,

I've been using this one since you posted it and i really like  
it.  VERY fast.


Thanks!

Just remember - it often gets the wrong answer on some systems  
(e.g. mine).
It believes I am always connected, even though about 50% of the  
time I'm not  - because I have an in-house network (mix of Cat-5  
and wifi) with an Internet connection which is *not* always connected.


Alex, thanks as always for pointing out the limitations. Can I pick  
your knowledge a little further?


Can the testForConnection function be assumed reliable for detecting  
a network connection of some sort, not necessarily the internet? I  
guess there are times when this might be sufficient.


Cheers
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-11 Thread Alex Tweedly

Dave Cragg wrote:



Just remember - it often gets the wrong answer on some systems  (e.g. 
mine).
It believes I am always connected, even though about 50% of the  time 
I'm not  - because I have an in-house network (mix of Cat-5  and 
wifi) with an Internet connection which is *not* always connected.



Alex, thanks as always for pointing out the limitations. 


Sorry - was I sounding like a broken record ? And a negative one at that :-(

It's just that if folks use it, and therefore wrongly think they are 
connected, then they (and perhaps I)  get poor results (like Rev 2.5's 
IDE trying to use the RevOnline check, where it would hang for 30-60 
seconds every time I tried to use it - BZ 2117, still open after 14 months).



Can I pick  your knowledge a little further?

Can the testForConnection function be assumed reliable for detecting  
a network connection of some sort, not necessarily the internet? 


yes


I  guess there are times when this might be sufficient.

I can't think of any circumstance that it is sufficient for anything 
meaningful.

If there is something it helps with, I'd be happy to hear about it.

(note you can have a network connection with nothing but a successful 
link status - i.e. a hub or switch, there is no certainty that any other 
computer is connected; I don't see how that is sufficient for anything).



--
Alex Tweedly   http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-11 Thread Dave Cragg


On 11 Dec 2005, at 19:16, Alex Tweedly wrote:


Sorry - was I sounding like a broken record ? And a negative one at  
that :-(


Not at all. I really appreciate it. I think many of us are now having  
to or wanting to deliver things that have to work in various  
networked settings, and we can get carried away with our little bits  
of knowledge. Although I  know something about things such as http  
and ftp protocols, I'm fairly ignorant about many aspects of  
networking.  I'm glad for any pointers  I can get (especially  
pointers to pitfalls).



Can the testForConnection function be assumed reliable for  
detecting  a network connection of some sort, not necessarily the  
internet?


yes


I  guess there are times when this might be sufficient.

I can't think of any circumstance that it is sufficient for  
anything meaningful.

If there is something it helps with, I'd be happy to hear about it.


I have nothing very practical in mind. But it's nice to store away  
these snippets of code with an accurate description of what they do.




(note you can have a network connection with nothing but a  
successful link status - i.e. a hub or switch, there is no  
certainty that any other computer is connected; I don't see how  
that is sufficient for anything).


Well, in a company setting, and the sales person has returned to the  
office from the road with his/her laptop, and has forgotten to plug  
it into the company network when he/she starts an app that requires a  
network connection... I guess it could perhaps give a better  
description of the problem than invalid host address. (Just  
thinking aloud here.)


Cheers
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-11 Thread Alex Tweedly

Dave Cragg wrote:



On 11 Dec 2005, at 19:16, Alex Tweedly wrote:



Sorry - was I sounding like a broken record ? And a negative one at  
that :-(



Not at all. I really appreciate it. I think many of us are now having  
to or wanting to deliver things that have to work in various  
networked settings, and we can get carried away with our little bits  
of knowledge. Although I  know something about things such as http  
and ftp protocols, I'm fairly ignorant about many aspects of  
networking.  I'm glad for any pointers  I can get (especially  
pointers to pitfalls).



Phew !
Thanks Dave - I was concerned that I was coming over as too negative too 
often on this topic.




I have nothing very practical in mind. But it's nice to store away  
these snippets of code with an accurate description of what they do.




(note you can have a network connection with nothing but a  
successful link status - i.e. a hub or switch, there is no  certainty 
that any other computer is connected; I don't see how  that is 
sufficient for anything).



Well, in a company setting, and the sales person has returned to the  
office from the road with his/her laptop, and has forgotten to plug  
it into the company network when he/she starts an app that requires a  
network connection... I guess it could perhaps give a better  
description of the problem than invalid host address. (Just  
thinking aloud here.)


I think that getting a negative result back from the test gives you the 
possibility of a better (and perhaps sooner) error message. I'll give 
some thought to how reliable that might be - but off the cuff, it seems 
safe to assume that if this test for network fails, then you really do 
have no network connection.


But in general, getting a positive result from the test gives you 
effectively nothing.


- even if there is a network connection,  there may be no internet 
connection
 (or in your case,  there may be no connectivity to the 
required part of the corporate network)
- even if there is an internet connection, the part of the net you want 
may not be reachable

-even if it is, the server may not be up and running
- even if it is, the service (e.g. http) you want may not be up
- even if it is, it may not accept your connection
- even if it does, the file you want may be unavailable
- even if ..

And even if the internet connection is up, and the first request is 
satisfied, it may then die / become unreachable before, or during, a 
subsequent request.


Bottom line : if you want to write a robust networked application, it 
should never do any blocking operation, should alway be prepared for 
errors (or delays) and should gracefully continue with other operations 
or user interactions in parallel with any attempted network operation.


And if you do all that anyway, then the initial test was unnecessary :-)

The exception might be, as you suggest, to give a better, quicker error 
response in some cases; whether that is worth the risk of unreliable or 
misleading error messages is up to the author of each app.


--
Alex Tweedly   http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-10 Thread Jerry Daniels

Kurt,

I've been using this one since you posted it and i really like it.  
VERY fast.


Thanks!

Jerry Daniels

Object Editing in a Tabbed Browser!
http://www.daniels-mara.com/products/constellation.htm



On Dec 6, 2005, at 8:06 PM, Kurt Kaufman wrote:

I don't remember who to thank for this one, which I modified only  
slightly:


on testForConnection
put 255.255.255.255:43222 into testSocket
open datagram socket to testSocket
put hostAddress(testSocket) into theIPAddress
close socket testSocket
if theIPAddress is 127.0.0.1 then
  --it's the local machine address, so not connected
  --may insert connection routine here
end  testForConnection


-Kurt
___
use-revolution mailing list
use-revolution@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-10 Thread Alex Tweedly

Jerry Daniels wrote:


Kurt,

I've been using this one since you posted it and i really like it.  
VERY fast.


Thanks!


Just remember - it often gets the wrong answer on some systems (e.g. mine).
It believes I am always connected, even though about 50% of the time I'm 
not  - because I have an in-house network (mix of Cat-5 and wifi) with 
an Internet connection which is *not* always connected.


-- Alex.

--
Alex Tweedly   http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-08 Thread J. Landman Gay

Marty Knapp wrote:
What happens if a Rev standalone runs out of memory (it's all in RAM, 
right?) Does it page it out to disk or does it just run into the wall? 
(need to know for both OSX and XP)


The engine uses virtual memory when necessary on all platforms. You 
should be fine.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-07 Thread Alex Tweedly

Kurt Kaufman wrote:

I don't remember who to thank for this one, which I modified only  
slightly:


on testForConnection
put 255.255.255.255:43222 into testSocket
open datagram socket to testSocket
put hostAddress(testSocket) into theIPAddress
close socket testSocket
if theIPAddress is 127.0.0.1 then
  --it's the local machine address, so not connected
  --may insert connection routine here
end  testForConnection

That tests for having a *network* connection, but not for having an 
*Internet* connection.


e.g. on my laptop, connected to my home network, this yields a value 
(today it's 192.168.1.67) regardless of whether the DSL line is 
connected and working or not.


I'm not even sure it adequately tests for a network connection - on a 
machine with a single network port and a static IP address, I think it 
might return that IP address even if the network was disconnected. I 
don't have a suitable machine to test that out on, and anyway the test 
would be incomplete because it could vary between OSes.


--
Alex Tweedly   http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-07 Thread capellan (sent by Nabble.com)

Hi Kurt,

 I don't remember who to thank for this one, 
 which I modified only slightly: 

Dar Scott published this code in march 2002:


local testSock
on mouseUp
   put 255.255.255.255:43222 into testSock
   open datagram socket to testSock  -- opens immediately on Win2K
   put hostAddress(testSock) into field Local IP Address
   close socket testSock
end mouseUp


--
Sent from the Revolution - User forum at Nabble.com:
http://www.nabble.com/How-do-i-check-for-an-internet-connection--t691676.html#a1841795
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-07 Thread Marty Knapp
What happens if a Rev standalone runs out of memory (it's all in RAM, 
right?) Does it page it out to disk or does it just run into the wall? 
(need to know for both OSX and XP)


Thanks,


Marty Knapp
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-06 Thread Bill Marriott
Easiest way is to check if you can connect to a known site (e.g. Google).

if the length of Xttp://www.google.com  0 then
-- we're connected
else
-- we're not connected
end if

(Change Xttp to http)


Nicholas Nginya wrote

 I am doing a cyber cafe billing system but how do i check for an internet 
 connection.



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-06 Thread Chipp Walters

Bill,

That will always return true.
I think what you meant to say was:

if the length of URL http://www.google.com;  0 then

Unfortunately, this solution doesn't work with some proxy servers.

-Chipp

Bill Marriott wrote:

Easiest way is to check if you can connect to a known site (e.g. Google).

if the length of Xttp://www.google.com  0 then
-- we're connected
else
-- we're not connected
end if


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-06 Thread Ton Cardona

Nicholas Nginya wrote

I am doing a cyber cafe billing system but how do i check for an 
internet

connection.



I've seen this one:

function wellConnected
  return URL http://www.google.com/;  empty
end wellConnected

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-06 Thread Andre Garzia

Kurt,

that's a little gem... nice, never thought of that, I did things like  
get URL http://www.soapdog.org/checknet.txt; and trapped for errors,  
of course this code breaks if my domain goes offline, but that code  
of yours, that holds!


Cheers
andre

On Dec 7, 2005, at 12:06 AM, Kurt Kaufman wrote:

I don't remember who to thank for this one, which I modified only  
slightly:


on testForConnection
put 255.255.255.255:43222 into testSocket
open datagram socket to testSocket
put hostAddress(testSocket) into theIPAddress
close socket testSocket
if theIPAddress is 127.0.0.1 then
  --it's the local machine address, so not connected
  --may insert connection routine here
end  testForConnection


-Kurt
___
use-revolution mailing list
use-revolution@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do i check for an internet connection?

2005-12-06 Thread Jerry Daniels
I keep a one byte file on the same web server that the application is  
accessing and test that with URL call. Fast.


Best,

Jerry Daniels

Tool makers for the 21st century
http://www.daniels-mara.com/products

On Dec 6, 2005, at 11:20 AM, Bill Marriott wrote:

Easiest way is to check if you can connect to a known site (e.g.  
Google).


if the length of Xttp://www.google.com  0 then
-- we're connected
else
-- we're not connected
end if

(Change Xttp to http)


Nicholas Nginya wrote

I am doing a cyber cafe billing system but how do i check for an  
internet

connection.




___
use-revolution mailing list
use-revolution@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution