title: How to optimize multiple web request in C#?
body: <p>I have to check around 10 url (sometimes more) in a WPF app, and display the result (just "is connected", or "can't connect". </p>
  
  <p>I've done something that works, with the code below : </p>
  
  <pre><code>foreach (string url in urlList)
  {
      CheckConnection(url); 
  }
  
  static async void CheckConnection(string url)
  {
      using (WebClient client = new WebClient())
      {
          bool succeed = true;
          try
          {
              await Task.Run(() =&gt; client.DownloadData(url));
          }
          catch
          {
              succeed = false;
          }
  
          if (succeed){ 
              //display "is connected"
          }
          else{
              //display "can't connect"
          }
      }
  }
  </code></pre>
  
  <p>The problem is that it takes too long to check everything, i dont know why, it seems that it takes way more time than it should. How can I optimize this? Is what I do the best way to do this?</p>