예제 #1
0
        /**
         * Method declaration
         *
         *
         * @param c
         * @param channel
         *
         * @return
         *
         * @throws Exception
         */
        private Result processDisconnect(Tokenizer c,
                                         Channel channel)
        {
            if (!channel.isClosed())
            {
                channel.disconnect();
                cChannel.Insert(channel.getId(), null);
            }

            return(new Result());
        }
예제 #2
0
        /**
         * Method declaration
         *
         *
         * @param c
         * @param channel
         *
         * @return
         *
         * @throws Exception
         */
        private Result processShutdown(Tokenizer c,
                                       Channel channel)
        {
            channel.checkAdmin();

            // don't disconnect system user; need it to save database
            for (int i = 1; i < cChannel.Count; i++)
            {
                Channel d = (Channel)cChannel[i];

                if (d != null)
                {
                    d.disconnect();
                }
            }

            cChannel.Clear();

            string token = c.getstring();

            if (token.Equals("IMMEDIATELY"))
            {
                close(-1);
            }
            else if (token.Equals("COMPACT"))
            {
                close(1);
            }
            else
            {
                c.back();
                close(0);
            }

            processDisconnect(c, channel);

            return(new Result());
        }