public void Run() { for (int i = 0; i < qtyMsg; i++) { mainProcess.Add("item " + i); } int total = 0; do { total = 0; foreach (var item in clients) { total += item.clientProcess.totalSent; } } while (total < qtyMsg * qtyClients); Console.WriteLine("clients: " + qtyClients); Console.WriteLine("msgs: " + qtyMsg); Console.WriteLine("totalsent: " + total); //Task.WaitAll(clientTasks.ToArray()); }
public void SendMessage(string s) { clientProcess.Add(s); }