title: .net or Xamarin Internet availability check when the WIFI network has no internet connection
body: <p>i know its a big discussion how to check if there is a internet connection available for the device.</p>
  
  <p>I tried Ping, WebClient and HTTPClient.
  I also use Xamarin Essentials and the Connectivity Plugin.</p>
  
  <p>All this things are working, just make a request to google or the server of your choice and you will get back the answer or not.
  You can also set a timeout for 2 seconds and so on.</p>
  
  <p>But now i came to the situation where i'm connected to the WIFI BUT the WIFI itself has no active internet connection.</p>
  
  <p>So all the things i wrote about was not working anymore. The problem is that the timeout will be ignored somehow. Maybe a bug in .net? I don't know.</p>
  
  <p>Now i found one last thing:</p>
  
  <pre><code>try
          {
              var request = (HttpWebRequest)WebRequest.Create("https://www.google.com");
              request.KeepAlive = false;
              request.Timeout = 2000;
  
              using (var response = (HttpWebResponse)await request.GetResponseAsync())
              {
                  if (response.StatusCode == HttpStatusCode.OK)
                  {
                      //Connection to internet available
                      return true;
                  }
                  else
                  {
                      //Connection to internet not available
                      return false;
                  }
              }
          }
          catch (WebException webEx)
          {
              if (webEx.Status == WebExceptionStatus.Timeout)
              {
                  return false;
              }
          }
          catch (Exception e)
          {
              return false;
          }
  </code></pre>
  
  <p>This was the only solution where i got the WebException when the 2 seconds timeout was reached.
  In all other solutions i stuck more than 1 minute till the timeout was reached. Also when i set it to 500ms or something.</p>
  
  <p>Did anybody know the reason why the given timeout is not reached for example with other methodes about?</p>