Ejemplo n.º 1
0
        public NetworkMessageRecoder(string filename, IMessageTypeInfo messageTypeInfo)
        {
            _messageTypeInfo = messageTypeInfo;

            _fileAppender = new BinaryFileAppender(filename);
            new NetworkMessageRecoderThread("recoderThread", this).Start();
        }
Ejemplo n.º 2
0
            public void Write(ISerializeInfo serializeInfo, MemoryStream _stream, BinaryFileAppender _fileAppender)
            {
                _stream.Seek(0, SeekOrigin.Begin);
                serializeInfo.Serialize(_stream, MessageBody);

                long lenght = _stream.Position;

                _fileAppender.Write((int)Stage);
                _fileAppender.Write((int)ProcessSeq);
                _fileAppender.Write((int)ChannelId);
                _fileAppender.Write((int)MessageType);
                _fileAppender.Write((int)lenght);
                _fileAppender.Write(_stream);
                //_logger.InfoFormat("Write:{0}, {1} ,{2} ",this, lenght, _fileAppender.Offset);
                _stream.Position = 0;
            }