NetworkMonitorT

#GNetworkMonitor 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.

Members

Classes

OnNetworkChangedDelegateWrapper
class OnNetworkChangedDelegateWrapper
Undocumented in source.

Functions

addOnNetworkChanged
gulong addOnNetworkChanged(void delegate(bool, NetworkMonitorIF) dlg, ConnectFlags connectFlags)

Emitted when the network configuration changes. If @available is %TRUE, then some hosts may be reachable that were not reachable before, while others that were reachable before may no longer be reachable. If @available is %FALSE, then no remote hosts are reachable.

canReach
bool canReach(SocketConnectableIF connectable, Cancellable cancellable)

Attempts to determine whether or not the host pointed to by @connectable can be reached, without actually trying to connect to it.

canReachAsync
void canReachAsync(SocketConnectableIF connectable, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously attempts to determine whether or not the host pointed to by @connectable can be reached, without actually trying to connect to it.

canReachFinish
bool canReachFinish(AsyncResultIF result)

Finishes an async network connectivity test. See g_network_monitor_can_reach_async().

getConnectivity
GNetworkConnectivity getConnectivity()

Gets a more detailed networking state than g_network_monitor_get_network_available().

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 reachable. See #GNetworkMonitor:network-available for more details.

getNetworkMetered
bool getNetworkMetered()

Checks if the network is metered. See #GNetworkMonitor:network-metered for more details.

getNetworkMonitorStruct
GNetworkMonitor* getNetworkMonitorStruct(bool transferOwnership)

Get the main Gtk struct

Static functions

callBackNetworkChanged
void callBackNetworkChanged(GNetworkMonitor* networkmonitorStruct, bool available, OnNetworkChangedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackNetworkChangedDestroy
void callBackNetworkChangedDestroy(OnNetworkChangedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

onNetworkChangedListeners
OnNetworkChangedDelegateWrapper[] onNetworkChangedListeners;
Undocumented in source.

Meta

Since

2.32