public ConnectionRequestConfirmReplyMessage(List <DnmpNode> clients, ushort newId, IEndPoint newEndPoint, IEndPointFactory endPointFactory, ISymmetricKey key) { Clients = clients; NewId = newId; NewEndPoint = newEndPoint; this.endPointFactory = endPointFactory; this.key = key; }
public ConnectionNotificationMessage(byte[] data, IEndPointFactory endPointFactory) { var reader = new BigEndianBinaryReader(new MemoryStream(data)); Client = new DnmpNode { Id = reader.ReadUInt16(), EndPoint = endPointFactory.DeserializeEndPoint(reader.ReadBytes(reader.ReadUInt16())), CustomData = reader.ReadBytes(reader.ReadUInt16()) }; }
public ConnectionRequestConfirmReplyMessage(byte[] data, IEndPointFactory endPointFactory, ISymmetricKey key) { var dataReader = new BigEndianBinaryReader(new MemoryStream(SymmetricHelper.Decrypt(key, data))); NewId = dataReader.ReadUInt16(); NewEndPoint = endPointFactory.DeserializeEndPoint(dataReader.ReadBytes(dataReader.ReadUInt16())); var clientCount = dataReader.ReadUInt16(); for (var i = 0; i < clientCount; i++) { Clients.Add(new DnmpNode { Id = dataReader.ReadUInt16(), ParentId = dataReader.ReadUInt16(), EndPoint = endPointFactory.DeserializeEndPoint(dataReader.ReadBytes(dataReader.ReadUInt16())), CustomData = dataReader.ReadBytes(dataReader.ReadUInt16()) }); } }
public ConnectionNotificationMessage(DnmpNode client, IEndPointFactory endPointFactory) { Client = client; this.endPointFactory = endPointFactory; }