private void button1_Click(object sender, EventArgs e) { //get IPadress and pass to ping function List <IPAddress> IPList = listNode.Select(o => IPAddress.Parse(o.IPAddress)).ToList(); networkHeartbeat = new NetworkHeartbeat(IPList, 1000, 5000, null, null); networkHeartbeat.PingUp += c_PingUp; networkHeartbeat.PingDown += c_PingDown; networkHeartbeat.Start(); }
private void networkHeartbeatStart() { //get IPadress and pass to ping function List <IPAddress> IPList = listNode.Select(o => IPAddress.Parse(o.IPAddress)).ToList(); networkHeartbeat = new NetworkHeartbeat(IPList, Properties.Settings.Default.PingTimeout, Properties.Settings.Default.PingDelay, listNode, System.IO.Path.GetRandomFileName()); networkHeartbeat.PingUp += c_PingUp; networkHeartbeat.PingDown += c_PingDown; GC.Collect(); GC.WaitForPendingFinalizers(); networkHeartbeat.Start(); }