Exemplo n.º 1
0
 public void EndPositionTestMethod()
 {
     ushort _length = 16;
       HeaderWriterTest _htw = new HeaderWriterTest(x => { });
       HeaderWriter _hw = new HeaderWriter(_htw, _length);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       Assert.AreEqual<long>(_length + 4, _htw.Position);
 }
Exemplo n.º 2
0
 public ProducerMessageHeader(IBinaryHeaderEncoder writer, FieldEncodingEnum encoding, MessageLengthFieldTypeEnum lengthFieldType, MessageTypeEnum messageType, ConfigurationVersionDataType configurationVersion)
 {
     m_MessageType = messageType;
     m_Encoding = encoding;
     m_lengthFieldType = lengthFieldType;
     m_HeaderWriter = new HeaderWriter(writer, PackageHeaderLength());
     MessageSequenceNumber = 0;
     ConfigurationVersion = configurationVersion;
 }
Exemplo n.º 3
0
 public void CreatorTestMethod()
 {
     HeaderWriterTest _htw = new HeaderWriterTest(x => { });
       HeaderWriter _hw = new HeaderWriter(_htw, 16);
       Assert.AreEqual(16, _htw.Position);
 }
Exemplo n.º 4
0
 public ProducerHeader(IBinaryHeaderEncoder writer, Guid producerId, IList<UInt16> dataSetWriterIds)
     : base()
 {
     if (writer == null)
       throw new ArgumentNullException(nameof(writer));
     PublisherId = producerId;
     NetworkMessageFlags = Convert.ToByte(PacketFlagsDefinitions.NetworkMessageType.RegularMessages);
     ProtocolVersion = CommonDefinitions.ProtocolVersion;
     SecurityTokenId = 0;
     NonceLength = 0;
     DataSetWriterIds = new ReadOnlyCollection<UInt16>(dataSetWriterIds);
     MessageCount = Convert.ToByte(DataSetWriterIds.Count);
     ushort _packetLength = Convert.ToUInt16(m_PacketHeaderLength + dataSetWriterIds.Count * 2);
     m_HeaderWriter = new HeaderWriter(writer, _packetLength);
 }