using System.Collections.Generic;
using System.Net.NetworkInformation;
static Disposable<List<Ping>> PingAll(List<Tuple<IPAddress,string>> a, Action<List<string>> completion)
List<string> results = new List<string>();
List<Ping> pings = new List<Ping>();
Action done = () => { if (doneCount >= a.Count) completion(results); };
p.PingCompleted += (o, e) => {
Interlocked.Increment(ref doneCount);
p.SendAsync(item.Item1, 1000);
Interlocked.Increment(ref doneCount);
return Disposable.AsDisposable(pings, () => pings.ForEach(p => p.Dispose()));