public override P2PHeader CreateAck() { P2Pv2Header ack = new P2Pv2Header(); if ((OperationCode & (byte)MSNPSharp.OperationCode.RAK) > 0) { ack.AckIdentifier = Identifier + MessageSize; ack.OperationCode = (byte)MSNPSharp.OperationCode.None; if (MessageSize > 0) { if (!IsAcknowledgement) { if ((OperationCode & (byte)MSNPSharp.OperationCode.SYN) != 0) { ack.OperationCode |= (byte)MSNPSharp.OperationCode.RAK; if (HeaderTLVs.ContainsKey(0x01)) { ack.HeaderTLVs.Add(0x01, HeaderTLVs[0x01]); //If this is an ACK, we MUST copy the peer info TLV. ack.OperationCode |= (byte)MSNPSharp.OperationCode.SYN; } } } } } else { throw new MSNPSharpException("This P2Pv2 message do not need to be acknowledged."); } return(ack); }
public override P2PHeader CreateNak() { P2Pv2Header nak = new P2Pv2Header(); nak.NakIdentifier = Identifier + MessageSize; return(nak); }
public override P2PHeader CreateNak() { P2Pv2Header nak = new P2Pv2Header(); nak.NakIdentifier = Identifier + MessageSize; return nak; }
public override P2PHeader CreateAck() { P2Pv2Header ack = new P2Pv2Header(); if ((OperationCode & (byte)MSNPSharp.OperationCode.RAK) > 0) { ack.AckIdentifier = Identifier + MessageSize; ack.OperationCode = (byte)MSNPSharp.OperationCode.None; if (MessageSize > 0) { if (!IsAcknowledgement) { if ((OperationCode & (byte)MSNPSharp.OperationCode.SYN) != 0) { ack.OperationCode |= (byte)MSNPSharp.OperationCode.RAK; if (HeaderTLVs.ContainsKey(0x01)) { ack.HeaderTLVs.Add(0x01, HeaderTLVs[0x01]); //If this is an ACK, we MUST copy the peer info TLV. ack.OperationCode |= (byte)MSNPSharp.OperationCode.SYN; } } } } } else { throw new MSNPSharpException("This P2Pv2 message do not need to be acknowledged."); } return ack; }