vintage_net v0.8.0 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

Specs

ping_error_reason() :: :if_not_found | :no_ipv4_address | :inet.posix()

Link to this section Functions

Specs

ping(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.