gio.network_monitor

Module for [NetworkMonitor] interface

Types 2

[gio.network_monitor.NetworkMonitor] provides an easy-to-use cross-platform API for monitoring network connectivity. On Linux, the available implementations are based on the kernel's netlink interface and on NetworkManager.

There is also an implementation for use inside Flatpak sandboxes.

Methods
gio.types.NetworkConnectivity connectivity() @propertyGet `connectivity` property. Returns: More detailed information about the host's network connectivity. See [gio.network_monitor.NetworkMonitor.getConnectivity] and #GNetworkConnectivity for more de...
bool networkAvailable() @propertyGet `networkAvailable` property. Returns: Whether the network is considered available. That is, whether the system has a default route for at least one of IPv4 or IPv6.
bool networkMetered() @propertyGet `networkMetered` property. Returns: Whether the network is considered metered.
gio.network_monitor.NetworkMonitor getDefault()Gets the default #GNetworkMonitor for the system. Returns: a #GNetworkMonitor, which will be a dummy object if no network monitor is available
bool canReach(gio.socket_connectable.SocketConnectable connectable, gio.cancellable.Cancellable cancellable = null)Attempts to determine whether or not the host pointed to by connectable can be reached, without actually trying to connect to it.
void canReachAsync(gio.socket_connectable.SocketConnectable connectable, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Asynchronously attempts to determine whether or not the host pointed to by connectable can be reached, without actually trying to connect to it.
bool canReachFinish(gio.async_result.AsyncResult result)Finishes an async network connectivity test. See [gio.network_monitor.NetworkMonitor.canReachAsync].
gio.types.NetworkConnectivity getConnectivity()Gets a more detailed networking state than [gio.network_monitor.NetworkMonitor.getNetworkAvailable].
bool getNetworkAvailable()Checks if the network is available. "Available" here means that the system has a default route available for at least one of IPv4 or IPv6. It does not necessarily imply that the public Internet is ...
bool getNetworkMetered()Checks if the network is metered. See #GNetworkMonitor:network-metered for more details. Returns: whether the connection is metered
gulong connectNetworkChanged(T)(T callback, Flag!"After" after = No.After)Connect to `NetworkChanged` signal.