Beispiel #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);
     //			}
 }
Beispiel #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;
         }
     }
 }
Beispiel #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);
 }
Beispiel #4
0
 public void SendMessageRemote(Message msg)
 {
     //TODO: Send message to control server.
     return;
 }
Beispiel #5
0
 public void AddMessage(Message msg)
 {
     messages.Add(msg);
 }