- In the Demo class, add a method called CheckClientMachinesOnline(), which takes as parameters a List<string> collection of IP addresses and an integer that specifies the minimum number of machines required to be online. Add a second method called MachineReturnedPing(), which will receive an IP address to ping. For our purpose, we will just return false to mimic a dead machine (the ping to the IP address timed out):
public class Recipes { public void CheckClientMachinesOnline(List<string> ipAddresses, int minimumLive) { } private bool MachineReturnedPing(string ip) { return false; } }
- Inside the CheckClientMachinesOnline() method, add the Parallel.ForEach loop and create the ParallelOptions variable that will ...