public override void Tick() { if (!SuccessfulSetup) { return; } if (!counting.Exists("Count")) { return; } Anima.Instance.WriteLine($"Attempting to send network messages"); var message = Anima.Serialize(new KeyValuePair <string, int>("Count", counting.Pool["Count"])); var tasks = outBoundClients.Where(tup => tup.Value > (MaxFailures * -1)).Select(tup => TrySendMessage(tup.Key, message)).ToArray(); Task.WaitAll(tasks); foreach (var task in tasks) { if (task.Result.Item1) { outBoundClients[task.Result.Item2]++; } else { outBoundClients[task.Result.Item2]--; } } }