Пример #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);
 }