title: HttpWebResponse get stuck while running in a loop
body: <p>I build this method (c#) in order to receive the HTTP response status code from an URL.
  whene I run this method ones it's works fine, but when I run it in a loop, the third time its stuck. any clue??</p>
  
  <pre><code> public static string isAlive(string url)
      {
          Console.WriteLine("start: Is Alive Test");
          WebRequest request = WebRequest.Create(url);
          try
          {
              HttpWebResponse response = (HttpWebResponse)request.GetResponse();
              return Convert.ToString((int)response.StatusCode);
          }
          catch(WebException ex)
          {
              HttpWebResponse res  = (HttpWebResponse)ex.Response;
              return Convert.ToString((int)res.StatusCode);
          }
      }
  </code></pre>
  
  <p>the loop</p>
  
  <pre><code>        for (int i = 0; i &lt; 5; i++)
          {
              string a = isAlive("https://www.yahoo.com/");
              Console.WriteLine(a);
          }
  </code></pre>