network_available


Description:

[ ConcreteAccessor ]
public abstract bool network_available { get; }

Whether the network is considered available.

That is, whether the system has a default route for at least one of IPv4 or IPv6.

Real-world networks are of course much more complicated than this; the machine may be connected to a wifi hotspot that requires payment before allowing traffic through, or may be connected to a functioning router that has lost its own upstream connectivity. Some hosts might only be accessible when a VPN is active. Other hosts might only be accessible when the VPN is not active. Thus, it is best to use can_reach or can_reach_async to test for reachability on a host-by-host basis. (On the other hand, when the property is false, the application can reasonably expect that no remote hosts at all are reachable, and should indicate this to the user in its UI.)

See also network_changed.