You are here

dbus

Querying Connectivity

You're application almost always needs to know if there is a working network connection. This is typically handled by placing the connection attempt in a try...catch block. That works, but can be slow, and it means the UI can't really adapt to the level of current connectivity. A much better solution is to query the NetworkManager [used by every mainstream distribution] via the System D-Bus for the current connectivity.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer