Is it valid to refer to i in the delegate statement?

```
targets[i].PingReply = e.Reply;

```

Will it refer to the same array element defined in 

```
pingSender.SendAsync( targets[i].IPAddress, targets[i].Timeout);

```

or is something different going for the value of i when the delegate fires? I ask because I'm getting an index out of bounds with i=3 in the PingCompleted and I'm not sure why.

```
public void Ping(PingTest[] targets)
{
    var finished = new CountdownEvent(targets.Count());
    for (int i = 0; i < targets.Count(); i++)
    {
        finished.AddCount();
        var pingSender = new Ping();
        pingSender.PingCompleted += (sender, e) =>
                                        {
                                            targets[i].PingReply = e.Reply;
                                            finished.Signal();
                                        };
        pingSender.SendAsync(targets[i].IPAddress, targets[i].Timeout);
    }
    finished.Signal();
    finished.Wait();
}

```

Here is the call...

```
var pingTests = new PingTest[]
                    {
                        new PingTest("Router", new IPAddress(new byte[] {192, 168, 1, 8}), 2),
                        new PingTest("Exchange", new IPAddress(new byte[] {192, 168, 1, 78}), 3),
                        new PingTest("SQL", new IPAddress(new byte[] {192, 168, 1, 99}), 3)
                    };
netwrkService.Ping(pingTests);

```