src/adapters/net.cpp
/**
   * Run ping command to test internet connectivity
   */
Run ping command to test internet connectivity
Run ping command to test internet connectivity
bool network::ping() const {
    try {
      auto exec = "ping -c 2 -W 2 -I " + m_interface + " " + string(CONNECTION_TEST_IP);
      auto ping = command_util::make_command<output_policy::IGNORED>(exec);
      return ping && ping->exec(true) == EXIT_SUCCESS;
    } catch (const std::exception& err) {
      return false;
    }
  }
bool network :: ping ( ) const { try { auto exec = " " + m_interface + " " + string ( CONNECTION_TEST_IP ) ; auto ping = command_util :: make_command < output_policy :: IGNORED > ( exec ) ; return ping && ping -> exec ( true ) == EXIT_SUCCESS ; } catch ( const std :: exception & err ) { return false ; } }
Run ping command to test internet connectivity
Run ping command to test internet connectivity