Esempio n. 1
0
 public IEndPoint GetMachine(NodeId node)
 {
     lock(nodeToMachine)
     {
         if(!nodeToMachine.ContainsKey(node))
             return null;
         return nodeToMachine[node].SingleOrDefault();
     }
 }
Esempio n. 2
0
 void GetNodesReply(RpcMail mail,IEndPoint ep, NodeId id, Dictionary<NodeId, List<IEndPoint>> nodes)
 {
     log.Info ("GetNodesReply", ep, id, nodes.Count);
     lock (nodeToMachine) {
         Add (ep, id);
         foreach (var kvp in nodes)
             foreach (var v in kvp.Value)
                 Add (v, kvp.Key);
     }
 }
Esempio n. 3
0
 public void Add(IEndPoint machine, NodeId node)
 {
     lock(nodeToMachine)
     {
         if(!nodeToMachine.ContainsKey(node))
             nodeToMachine[node] = new List<IEndPoint>();
         if(!nodeToMachine[node].Contains(machine))
             nodeToMachine[node].Add(machine);
     }
     NodeFound.FireEventAsync (machine, node);
 }
Esempio n. 4
0
 public bool Equals(NodeId n)
 {
     return n.Id == Id;
 }