Beispiel #1
0
        /*
         * INVALID_RESPONSE
         * @function        Handle an invalid heartbeat response from the server.
         * @return          void
         */
        private void nullBeat()
        {
            killSwitch eClient = new killSwitch(3);
            Thread     eKick   = new Thread(eClient.killClient);

            eKick.Start();
            MessageBox.Show("WARNING: Invalid Heartbeat Response", "Guard . Dialog", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop);
        }
Beispiel #2
0
        /*
         *  HEARTBEAT_RESPONSE_LOOP
         *  @function       Loop 'getBeat' while module is active.
         *  @return         void
         */
        private void doBeat()
        {
            while (Active)
            {
                switch (getBeat())
                {
                case true:
                    int hbMs = (Delay * 1000);
                    Thread.Sleep(hbMs);
                    break;

                case false:
                    Active = false;
                    killSwitch eClient = new killSwitch(5);
                    Thread     eKick   = new Thread(eClient.killClient);
                    eKick.Start();
                    MessageBox.Show("Connection Closed by Server", "Guard . Dialog", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop);
                    break;
                }
            }
        }