예제 #1
0
        public void DeserializeLocal(BinaryReader reader)
        {
            isUserMsg = true;
            reader.BaseStream.Position = 0;
            byte      flags  = reader.ReadByte();
            FlagsByte bFlags = new FlagsByte();

            bFlags.DataByte = flags;
            //Headers are in sequence 1. COR  2. TOTAL 3. TCP
            headers = new Hashtable();
            if (bFlags.AnyOn(FlagsByte.Flag.COR))
            {
                RequestCorrelator.HDR corHdr = new RequestCorrelator.HDR();
                corHdr.DeserializeLocal(reader);
                headers.Add(HeaderType.REQUEST_COORELATOR, corHdr);
            }

            if (bFlags.AnyOn(FlagsByte.Flag.TOTAL))
            {
                TOTAL.HDR totalHdr = new TOTAL.HDR();
                totalHdr.DeserializeLocal(reader);
                headers.Add(HeaderType.TOTAL, totalHdr);
            }

            if (bFlags.AnyOn(FlagsByte.Flag.TCP))
            {
                TcpHeader tcpHdr = new TcpHeader();
                tcpHdr.DeserializeLocal(reader);
                headers.Add(HeaderType.TCP, tcpHdr);
            }

            prio = (Priority)Enum.ToObject(typeof(Priority), reader.ReadInt16());
            handledAsynchronously = reader.ReadBoolean();
            long ticks = reader.ReadInt64();

            arrivalTime      = new DateTime(ticks);
            ticks            = reader.ReadInt64();
            sendTime         = new DateTime(ticks);
            responseExpected = reader.ReadBoolean();
            _type            = reader.ReadByte();

            length = reader.ReadInt32();
            buf    = (byte[])reader.ReadBytes(length);
        }