[Gambas-user] wlan ready?

tobi tobiasboege01 at ...1601...
Sat Mar 17 14:47:33 CET 2012


hi,

On Sat, 17 Mar 2012, Randall Morgan wrote:

> You could call ping on a know external server and then examine the
> results...
> 
> Or simply loop trying to use curl to connect to an external server.
> 
> 
> 
> 
> 
> On Sat, Mar 17, 2012 at 5:05 AM, Bill-Lancaster
> <bill-lancaster at ...2231...>wrote:
> 
> >
> > Gambas 3, Ubuntu 12.04, kde
> > Is there a way to check if my wlan is connected?
> > I want to run a project at startup that needs the wlan which sometime takes
> > a little while to connect.
> > I could use delay() but that is not very elegant!
> > Bill Lancaster
> > --
> > View this message in context:
> > http://old.nabble.com/wlan-ready--tp33522345p33522345.html
> > Sent from the gambas-user mailing list archive at Nabble.com.
> >
> >
> >
> > ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> 
> 
> 
> -- 
> If you ask me if it can be done. The answer is YES, it can always be done.
> The correct questions however are... What will it cost, and how long will
> it take?
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here 
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

that's a question, very difficult to answer. do you want to know if you have access to the internet
or just connected to a router? the internet thing won't be possible without relying on an external
server (right?) which may have downtimes...
however, there should be system files/logs that indicate the current status. apart from logfiles (on
my arch linux setup, i could use /var/log/boot), there could be kde-specific things; i don't know.
what works for me and seems to be an acceptable idea (?) is checking if i have a route associated
with my wlan device:

$ cat /proc/net/route

or alternatively

$ cat /proc/net/wireless

(if present - i have it)
which gives information about the wireless devices, here the status field may be interesting. i read
that iwconfig(1) reads the same info, but it displays it nicelier. i think, this information is more
reliable than ping(1)ing some servers. there is so much that can happen between you and it - and
moreover, what can you - as a regular user - do besides checking if you are connected to a
gateway/router? that's the only thing you can control.

sorry, i'm not very far into those network things...




More information about the User mailing list