Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 internal void CallMessageReceived(Message message)
 {
     MessageReceived(this, new MessageReceivedEventArgs { Message = message });
 }
Ejemplo n.º 3
0
 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);
 }