Esempio n. 1
0
        public virtual void Decode(ChannelBuffer buf, IMessageTree tree)
        {
            // buf.ReadInt();// read body length

            DecodeHeader(buf, tree);

            if (buf.ReadableBytes() > 0)
            {
                DecodeMessage(buf, tree);
            }
        }
Esempio n. 2
0
        protected internal void DecodeMessage(ChannelBuffer buf, IMessageTree tree)
        {
            Stack <ITransaction> stack  = new Stack <ITransaction>();
            IMessage             parent = DecodeLine(buf, null, stack, tree);

            tree.Message           = parent;
            tree.EstimatedByteSize = parent.EstimateByteSize();

            while (buf.ReadableBytes() > 0)
            {
                IMessage message = DecodeLine(buf, (ITransaction)parent, stack, tree);

                if (message is ITransaction)
                {
                    parent = message;
                }
                else
                {
                    break;
                }
            }
        }