コード例 #1
0
        private void ShutdownState()
        {
            Disconnect();
            State  = DemonState.None;
            Status = DemonStatus.None;

            if (Owner.Valid)
            {
                try
                {
                    // NOTE: No need to close the connection
                    QuitRequestCommand command = new QuitRequestCommand(Owner);
                    command.Execute();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
コード例 #2
0
        private void QuitState()
        {
            try
            {
                // NOTE: No need to close the connection
                QuitRequestCommand command = new QuitRequestCommand(Owner);
                HttpCode           code    = command.Execute();
                if (code != HttpCode.Ok)
                {
                    Status = DemonStatus.Warning;
                }

                Sleep(DemonTimeout.Ping, DemonState.Init);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                State  = DemonState.Restart;
                Status = DemonStatus.Error;
            }
        }