Esempio n. 1
0
            /// <summary>
            /// Decodes the specified session.
            /// </summary>
            /// <param name="inbuf">The inbuf.</param>
            /// <param name="output">The protocol output.</param>
            /// <returns></returns>
            public MessageDecoderResult Decode(ByteBuffer inbuf, IProtocolDecoderOutput output)
            {
                byte[] header = new byte[4];
                inbuf.GetBytes(header);
                ProtocolInitiation pi = new ProtocolInitiation();

                pi.Header           = new char[] { 'A', 'M', 'Q', 'P' };
                pi.ProtocolClass    = inbuf.GetByte();
                pi.ProtocolInstance = inbuf.GetByte();
                pi.ProtocolMajor    = inbuf.GetByte();
                pi.ProtocolMinor    = inbuf.GetByte();
                output.Write(pi);
                return(MessageDecoderResult.OK);
            }
Esempio n. 2
0
 /// <summary>
 /// Decodes the specified session.
 /// </summary>
 /// <param name="inbuf">The inbuf.</param>
 /// <param name="output">The protocol output.</param>
 /// <returns></returns>
 public MessageDecoderResult Decode(ByteBuffer inbuf, IProtocolDecoderOutput output)
 {
     byte[] header = new byte[4];
     inbuf.GetBytes(header);
     ProtocolInitiation pi = new ProtocolInitiation();
     pi.Header = new char[]{'A','M','Q','P'};
     pi.ProtocolClass = inbuf.GetByte();
     pi.ProtocolInstance = inbuf.GetByte();
     pi.ProtocolMajor = inbuf.GetByte();
     pi.ProtocolMinor = inbuf.GetByte();
     output.Write(pi);
     return MessageDecoderResult.OK;
 }