Executes a network ping on a collection of remote servers.
Inheritance Hierarchy
CleanCode.Threading ThreadWorker
CleanCode.Net PingWorker
Namespace: CleanCode.Net
Assembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax
public class PingWorker : ThreadWorker
Remarks
PingWorker is an implementation of the abstract ThreadWorker class, which performs work in a background thread allowing your foreground GUI to continue interacting with a user. Results are returned via a callback routine that is invoked when you poll for completed items.
See the remarks for ThreadManager for a comprehensive discussion of how to wire up and use ThreadWorkers.
Since CleanCode 0.9.07.
Examples
private void MyUpdater(string ip, string msg, IPStatus ipStatus) { . . . }
PingWorker.PingUpdater pingCallback =
new PingWorker.PingUpdater(MyUpdater);
pingWorker = new PingWorker(pingCallback, timeout); threadManager.Add(pingWorker); pingWorker.SetIpAddressList(ipList); threadManager.Run(); // start threads
threadManager.Run();
pingWorker.UpdateResults();
See Also