VintageNet.Interface.InternetTester (vintage_net v0.10.5) View Source
This module contains functions for testing whether the Internet is available.
See the InternetConnectivityChecker for a GenServer that checks on regular intervals and updates VintageNet properties as needed.
Link to this section Summary
Functions
Check connectivity with another device
Link to this section Types
Specs
ping_error_reason() :: :if_not_found | :no_ipv4_address | :inet.posix()
Link to this section Functions
Specs
ping(VintageNet.ifname(), {VintageNet.any_ip_address(), non_neg_integer()}) :: :ok | {:error, ping_error_reason()}
Check connectivity with another device
The "ping" is really a TCP connection attempt from the specified interface to an IP address and port. Failures to connect don't necessarily mean that the Internet is down, but it's likely especially if the server that's specified in the configuration is highly available.
Source IP-based routing is required for the TCP connect to go out the right network interface. This is configured by default when using VintageNet.