title: Running a Ping.SendAsync with status message
body: <p>I am creating a reporting system to check the status of blades. I know the code below works, but it is painstakingly slow. I looked up information about running Ping.SendAsync and it looks promising, but it doesn't run a status report on the ping unless it is in a handler. The problem with that, is that i need to access other objects in the function to change the webpage correctly. </p>
  
  <pre><code>protected void RadGridDellBlade_ItemDataBound(object sender, GridItemEventArgs e)
      {
          if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
          {
              thing1 t1 = new thing1();
              BladeRunnerDataAccess td = new BladeRunnerDataAccess(t1);
              try
              {
                  Image icon = (Image)e.Item.FindControl("Dell_imgIcon");
                  BladeWorkstation blade = (BladeWorkstation)e.Item.DataItem;
                  Ping pingSender = new Ping();
                  PingReply reply = pingSender.Send(blade.IPAddress);
  
                  switch (reply.Status)
                  {
                      case IPStatus.Success:
                          icon.ImageUrl = "~/Images/GreenIcon.png";
                          break;
                      case IPStatus.TimedOut:
                          icon.ImageUrl = "~/Images/RedIcon.png";
                          break;
                      default:
                          icon.ImageUrl = "~/Images/GrayIcon.png";
                          break;
                  }
                  Image Dell_osbit = (Image)e.Item.FindControl("Dell_OSbit");
                  switch (blade.BladeOSID)
                  {
                      case 1:
                          Dell_osbit.ImageUrl = "~/Images/xp.png";
                          break;
                      case 2:
                          Dell_osbit.ImageUrl = "~/Images/32bit.png";
                          break;
                      case 3:
                          Dell_osbit.ImageUrl = "~/Images/64bit.png";
                          break;
                  }
              }
              catch (Exception ex)
              {
  
              }
              finally
              {
                  t1.Dispose();
              }
          }
      }
  </code></pre>
  
  <p>This code works but runs all 250 blades one at a time and takes minutes. Is there a way to do this parallel or with threading, and keep the status check as well? I appreciate any help!!</p>