示例#1
0
 public void SendMessage(Message msg)
 {
     //If msg is to local, send it back, else send it to recipient
     //			if (msg.To.Host.Equals(localControl.GetHostIp().ToString()))
     //			{
     //				localControl.RecieveMessage(msg);
     //			}
 }
示例#2
0
 public void RecieveMessage(Message msg)
 {
     //Got message
     //Give it to the right actor
     //TODO:Make it find the actor in hash
     foreach (Actor a in Actors)
     {
         if (a.LocalId.ActorIdentifier == msg.To.ActorIdentifier)
         {
             a.AddMessage(msg);
             break;
         }
     }
 }
示例#3
0
 //Class to control the actors. Control the communication and creation of new actors
 public void Send(Id to, Id fromActor, Object content)
 {
     //Send the message content to "to"
     Message msg = new Message(to, fromActor, content);
     if (to.Host.Equals(fromActor.Host))
         RecieveMessage(msg);
     else
         SendMessageRemote(msg);
 }
示例#4
0
 public void SendMessageRemote(Message msg)
 {
     //TODO: Send message to control server.
     return;
 }
示例#5
0
 public void AddMessage(Message msg)
 {
     messages.Add(msg);
 }