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