* Problem: When Pinging an offline device it takes 10-15 seconds.
* Goal: I would like to end/kill/stop or what ever is necessary the background worker if the ping or backgroundworker runs for longer then 5 seconds.
Any suggestions how i can do this?

Currently when i ping a device that's online it reply back within the first second.

```
private void backgroundWorkerPing_DoWork(object sender, DoWorkEventArgs e)
{
    string pcName = e.Argument.ToString();

    lblIPAddress.Invoke((Action)(() => lblIPAddress.ForeColor = Color.Black));

    lblStatus.GetCurrentParent().Invoke((Action)(() => lblStatus.Text = String.Format("Pinging {0}", pcName)));                

    string ipAddress = GetSinglePing(pcName);                       
    e.Result = ipAddress;
}

private string GetSinglePing(string pcName)
{
    Network net = new Network();
    return net.Pinger(pcName);
}

public class Network
{
    //My Ping Method
    public string Pinger(string pcName, int bufferSize = 32)
    {
        Ping ping = new Ping();
        byte[] buffer = new byte[bufferSize];
        PingOptions pingOpt = new PingOptions(64, true);            

        try
        {
            PingReply pingReply = ping.Send(pcName, 100, buffer, pingOpt);

            if (pingReply.Status == IPStatus.Success)
            {
                return pingReply.Address.ToString();
            }
            else
            {
                return "Offline";
            }
        }
        catch
        {
            return "Offline";
        }
    }            
}

```