hi,

this for sure isn't the best solution but my first thought was using 
ifconfig to determine if your internet interface (maybe eth0 or 
whatever) has an ip address which should mean that it is connected..? (i 
don't know how it works with a modem)
this way you are at least independant of a test server.

another way may be found according to the following test:
in my case, i am connected to the internet via wlan0. my eth0 isn't 
connected to anything. in a terminal:
$ curl --interface wlan0 google.de
returns some html, while
$ curl --interface eth0 google.de
throws "curl: (7) Couldn't bind to 'eth0'"

but if i bring my inet connection with wlan0 down
$ curl --interface eth0 google.de
and
$ curl --interface wlan0 google.de
both will give "curl: (6) Couldn't resolve host 'google.de'"

if you look up the class Net in gb.net you'll find that there are status 
codes for those cases. so, if you haven't got a connection we are 
dependent on dns. but if you specify an non-existing host in a request 
with connection to the internet you'll get the same error. so far you 
are dependent of a test server again.

maybe this test inspires you...

regards,
tobi

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to