[Sugar-devel] [DESIGN] Reflect internet connectivity in the 'Network' frame icon

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Wed Feb 16 04:53:47 EST 2011


Excerpts from Martin Langhoff's message of Tue Feb 15 14:57:01 +0100 2011:

> Going back to your original post to note something important: these
> statuses aren't important _just_ to show in the UI. This should be a
> system status property that can be queried by activities and by
> cronjobs / cli utils.

Please be very careful with this. If your sensor incorrectly detects
that no internet connection is available, everything that relies on it
will break. Even just checking the NetworkManager status without a way
for the user to override it is a bad idea since NetworkManager might not
have a complete idea of what's going on [1,2].

When trying to check availability of "the internet", you are bound to
get false positives. The server(s) you ping in your sensor might be
down even though the server you are going to connect is still be 
reachable. The IPv4 default route might be down, but there might still
be a way to reach the target (IPv6, proxy, ...).

Unless there's a large application-level cost associated to it, it
might be a better idea to just try establishing the connection. A
SYN packet is as cheap as an ICMP echo request and you'll know for
sure whether the exact server you're trying to reach is available or
not.

The "internet" sensor might be useful to monitor changes and trigger
connection attempts, though. If you use exponential back-off, you could
reset the retry timer whenever the sensor switches from "offline" to
"online".

Sascha

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511439#35
[2] https://bugzilla.gnome.org/show_bug.cgi?id=418745
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110216/4540313a/attachment-0001.pgp>


More information about the Sugar-devel mailing list