Detect if the current environment has a network connection.
Create a socket connection to the hostname and check if the connection
is successful.
- Parameters
-
- Returns
- True if the current environment has a network connection,
False otherwise.
- Return type
bool