internal void SendMessage(string to, string from, string message) { //Send the message to all of the services var sender = Local.FirstOrDefault(i => i.GUID.ToString() == from); var node = Nodes.FirstOrDefault(i => i.GUID.ToString() == to); if (node == null) throw new Exception("Unknown node, cannot send message to non known addresses. Try discovering!"); var msg = new Message(node, sender, message).ToString(); foreach (ServiceConnection connection in Connections.Where(i => i.Available)) connection.Send(msg); }
internal void CallMessageReceived(Message message) { MessageReceived(this, new MessageReceivedEventArgs { Message = message }); }
internal void SendMessage(string to, string message) { //Send the message to all of the services var node = Nodes.FirstOrDefault(i => i.GUID.ToString() == to); var msg = new Message(node, message).ToString(); foreach (ServiceConnection connection in Connections.Where(i => i.Available)) connection.Send(msg); }