Beispiel #1
0
        public override KadNetwork <int, IEnumerable <string>, IntSetKadNode> CreateKadNetwork()
        {
            var result = new IntSetKadNetwork();

            IntSetKadNode node1 = result.Add(2);
            IntSetKadNode node2 = result.Add(3);
            IntSetKadNode node3 = result.Add(4);
            IntSetKadNode node4 = result.Add(5);

            // all nodes knows about all others
            for (int i = 0; i < result.Count; i++)
            {
                for (int j = 0; j < result.Count; j++)
                {
                    if (j != i)
                    {
                        result[i].KadCore.RoutingTable.Add(result[j].KadCore.NodeIdentifier);
                    }
                }
            }

            return(result);
        }
Beispiel #2
0
 public IntSetKadNode(IKadCore <int, IEnumerable <string> > kadCore, IntSetKadNetwork network) : base(kadCore)
 {
     _network = network;
 }