public override bool ProcessCommand(byte[] buffer, int offset, int count) //处理分完包的数据,子类从这个方法继承
        {
            ThroughputSocketCommand command = StrToCommand(m_incomingDataParser.Command);

            m_outgoingDataAssembler.Clear();
            m_outgoingDataAssembler.AddResponse();
            m_outgoingDataAssembler.AddCommand(m_incomingDataParser.Command);
            if (command == ThroughputSocketCommand.CyclePacket)
            {
                return(DoCyclePacket(buffer, offset, count));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="buffer"></param>
        /// <param name="offset"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public override bool ProcessCommand(byte[] buffer, int offset, int count) //
        {
            ThroughputSocketCommand command = StrToCommand(m_incomingDataParser.Command);

            m_outgoingDataAssembler.Clear();
            m_outgoingDataAssembler.AddResponse();
            m_outgoingDataAssembler.AddCommand(m_incomingDataParser.Command);
            if (command == ThroughputSocketCommand.CyclePacket)
            {
                return(DoCyclePacket(buffer, offset, count));
            }
            else
            {
                Program.Logger.Error("Unknow command: " + m_incomingDataParser.Command);
                return(false);
            }
        }