コード例 #1
0
ファイル: Main.cs プロジェクト: CharlesMartel/Presto
 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
ファイル: Cluster.cs プロジェクト: CharlesMartel/Presto
 /// <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
ファイル: Cluster.cs プロジェクト: CharlesMartel/Presto
 /// <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);
 }