예제 #1
0
파일: Form1.cs 프로젝트: tranxuanhuy/amhs
        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();
        }
예제 #2
0
파일: Form1.cs 프로젝트: tranxuanhuy/amhs
        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();
        }