/// <summary> /// Sends the P2PMessage directly over the socket. Accepts P2PDCMessage and P2PMessage objects. /// </summary> /// <param name="message"></param> public void SendMessage(NetworkMessage message) { // if it is a regular message convert it P2PDCMessage p2pMessage = message as P2PDCMessage; if (p2pMessage == null) { p2pMessage = new P2PDCMessage(message as P2PMessage); } SendMessage(p2pMessage, null); }
/// <summary> /// Constructs a NotificationMessage from the inner body contents of the specified message object. /// This will also set the InnerMessage property of the message object to the newly created NotificationMessage. /// </summary> public NotificationMessage(NetworkMessage message) { ParseBytes(message.InnerBody); message.InnerMessage = this; }
public virtual void SendMessage(NetworkMessage message, int transactionID) { NSMessage nsMessage = message as NSMessage; if (nsMessage == null) { Trace.WriteLineIf(Settings.TraceSwitch.TraceError, "Cannot use this Message Processor to send a " + message.GetType().ToString() + " message.", GetType().Name); return; } nsMessage.TransactionID = transactionID; nsMessage.PrepareMessage(); Trace.WriteLineIf(Settings.TraceSwitch.TraceVerbose, "Outgoing message:\r\n" + nsMessage.ToDebugString() + "\r\n", GetType().Name); // convert to bytes and send it over the socket Processor.Send(nsMessage.GetBytes(), transactionID); }
public void SendMessage(NetworkMessage message) { SendMessage(message, IncreaseTransactionID()); }
/// <summary> /// Creates the network message based on the inner contents of the parent message. It invokes the /// <see cref="ParseBytes"/> method to parse the inner body contents of the parent message. /// </summary> /// <param name="containerMessage"></param> public void CreateFromParentMessage(NetworkMessage containerMessage) { ParentMessage = containerMessage; ParentMessage.InnerMessage = this; if (ParentMessage.InnerBody != null) ParseBytes(ParentMessage.InnerBody); }
public virtual void SendMessage(NetworkMessage message) { Send(message.GetBytes()); }
public P2PMimeMessage(string destString, string srcString, NetworkMessage payLoad) : base() { MimeHeader["P2P-Dest"] = destString; MimeHeader["P2P-Src"] = srcString; MimeHeader[MIMEContentHeaders.ContentType] = "application/x-msnmsgrp2p"; InnerMessage = payLoad; }