Example #1
0
        // Finds closest GUIDs and searches for closest peers to them in the network
        private void searchTargetPeers()
        {
            List <int> targetGUIDs = routingTable.getTargetGUIDs(myInfo.getGUID);

            foreach (int guid in targetGUIDs)
            {
                PeerInfo closest = routingTable.findClosest(guid);
                if (closest != null && myInfo.getGUID != closest.getGUID)
                {
                    //routingTable.remove(closest.getGUID);
                    SearchChannel channel = new SearchChannel(this, guid);
                    channel.onReceiveClosest(closest);
                    channels.Add(channel);
                }
            }
        }