Esempio n. 1
0
        static RejectResponse()
        {
            RejectResponse r = null;

            StructSize = PropInfo.GetSize(r, o => o.InputTime) +
                         PropInfo.GetSize(r, o => o.OutputTime) +
                         PropInfo.GetSize(r, o => o.Time) +
                         16 + // RequestId
                         PropInfo.GetSize(r, o => o.ErrorCodeInternal);
        }
Esempio n. 2
0
        public static RejectResponse ReadFromBuffer(MessageHeader frame, ByteBuffer buf, int offset = 0)
        {
            if (buf.length - offset < StructSize)
            {
                return(null);
            }
            var resp = new RejectResponse();

            resp.InputTime = BitConverter.ToUInt64(buf.data, offset);
            offset        += PropInfo.GetSize(resp, o => o.InputTime);

            resp.OutputTime = BitConverter.ToUInt64(buf.data, offset);
            offset         += PropInfo.GetSize(resp, o => o.OutputTime);

            resp.Time = BitConverter.ToUInt64(buf.data, offset);
            offset   += PropInfo.GetSize(resp, o => o.Time);

            resp.RequestId = encoding.GetString(buf.data, offset, 16).Trim((char)0);
            offset        += 16;

            resp.ErrorCodeInternal = BitConverter.ToInt16(buf.data, offset);

            return(resp);
        }