NetworkMonitor.getConnectivity

Gets a more detailed networking state than gio.network_monitor.NetworkMonitor.getNetworkAvailable.

If #GNetworkMonitor:network-available is false, then the connectivity state will be gio.types.NetworkConnectivity.Local.

If #GNetworkMonitor:network-available is true, then the connectivity state will be gio.types.NetworkConnectivity.Full (if there is full Internet connectivity), gio.types.NetworkConnectivity.Limited (if the host has a default route, but appears to be unable to actually reach the full Internet), or gio.types.NetworkConnectivity.Portal (if the host is trapped behind a "captive portal" that requires some sort of login or acknowledgement before allowing full Internet access).

Note that in the case of gio.types.NetworkConnectivity.Limited and gio.types.NetworkConnectivity.Portal, it is possible that some sites are reachable but others are not. In this case, applications can attempt to connect to remote servers, but should gracefully fall back to their "offline" behavior if the connection attempt fails.

interface NetworkMonitor
getConnectivity
()

Return Value

Type: gio.types.NetworkConnectivity

the network connectivity state