vintage_net v0.5.1 VintageNet.Interface.InternetTester 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
This "ping"'s a server on the Internet that has a good chance being available
Link to this section Types
ping_error_reason()
View Sourceping_error_reason() :: :if_not_found | :no_ipv4_address | :inet.posix()
Link to this section Functions
ping(ifname)
View Sourceping(VintageNet.ifname()) :: :ok | {:error, ping_error_reason()}
This "ping"'s a server on the Internet that has a good chance being available
The "ping" is really a TCP connection attempt from the specified interface. 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.