private void SendAttributeReply(IPEndPoint target, short transactionId) { AttributeReplyPacket reply = new AttributeReplyPacket(); FillHeader(reply.Header, transactionId); reply.AttrList = AttributeString; socket.Send(target, reply); }
/// <summary> /// Processes the attribute reply. /// </summary> /// <param name="attributeReply">The attribute reply packet.</param> /// <param name="ipAddress">The ip address the reply originated from.</param> protected void ProcessAttributeReply(AttributeReplyPacket attributeReply, IPEndPoint ipAddress) { if (attributeReply.ErrorCode == SlpErrorCode.None) { AttributeReplyEventArgs args = new AttributeReplyEventArgs() { Address = ipAddress, RequestId = attributeReply.Header.XId }; args.Attributes = SplitAttributeList(attributeReply.AttrList); if (AttributeReply != null) { AttributeReply(this, args); } } }
protected override void ProcessPacket(NewPacketEventArgs packetInfo) { DirectoryAgentAdvertPacket daAdvert = packetInfo.Packet as DirectoryAgentAdvertPacket; if (daAdvert != null) { DirectoryAgent = new DirectoryAgentInformation(daAdvert.Url, packetInfo.SourceEndPoint); } ServiceReplyPacket serviceReply = packetInfo.Packet as ServiceReplyPacket; if (serviceReply != null) { ProcessServiceReply(serviceReply, packetInfo.SourceEndPoint); } AttributeReplyPacket attributeReply = packetInfo.Packet as AttributeReplyPacket; if (attributeReply != null) { ProcessAttributeReply(attributeReply, packetInfo.SourceEndPoint); } }