title: Ping to server for external connectivity
body: <p>I have a c# application that has a module for checks the server connection. The relevant code is like the following:</p>
  
  <pre><code>private void PingCheck(string hostName)
  {
      using (var p = new Ping())
      {
          try
          {
              var pr = p.Send(hostName, 2000);
  
              if (pr.Status != IPStatus.Success)
              {
                  log.ErrorFormat("Ping error! Host = {0},  Ping status = {1}", hostName, pr.Status.ToString());
              }
          }
          catch (Exception exc)
          {
              log.Error("Ping error!", exc);
          }
      }
  }    
  </code></pre>
  
  <p>We have deployed this application to our server that is inside the same network as the target machine. That's why this method checks internal connectivity. Is there any way to check server external connectivity? Because sometimes server connection is available in our network although connection from external network is down. How can I achieve this?</p>