示例#1
0
 void Cluster_MessageRecieved(string payload, ClusterNode sender)
 {
     //if this is the response message, write the response to the console.
     if (payload == "response")
     {
         Console.WriteLine("Response from: " + sender.HostName);
     }
     else
     {
         Cluster.SendMessage(sender, "response");
     }
 }
示例#2
0
 /// <summary>
 /// Deliver the message from a remote node.
 /// </summary>
 /// <param name="payload">The message sent.</param>
 /// <param name="sender"> The Node ID of the sending node.</param>
 internal static void DeliverMessage(string payload, ClusterNode sender)
 {
     MessageRecieved(payload, sender);
 }
示例#3
0
 /// <summary>
 /// Deliver the message from a remote node.
 /// </summary>
 /// <param name="payload">The message sent.</param>
 /// <param name="sender"> The Node ID of the sending node.</param>
 internal static void DeliverMessage(string payload, ClusterNode sender)
 {
     MessageRecieved(payload, sender);
 }
示例#4
0
 /// <summary>
 /// Send a message to the node with the specified ID. The message is delivered to 
 /// the receiving node and calls the MessageReceived event.
 /// </summary>
 /// <param name="nodeID">The node ID of the node to send the message to.</param>
 /// <param name="message">The message to be sent.</param>
 public static void SendMessage(ClusterNode node, string message)
 {
     ClusterProxy.SendMessage(node.NodeID, message, Key);
 }
示例#5
0
 /// <summary>
 /// Send a message to the node with the specified ID. The message is delivered to
 /// the receiving node and calls the MessageReceived event.
 /// </summary>
 /// <param name="nodeID">The node ID of the node to send the message to.</param>
 /// <param name="message">The message to be sent.</param>
 public static void SendMessage(ClusterNode node, string message)
 {
     ClusterProxy.SendMessage(node.NodeID, message, Key);
 }