Example #1
0
        public ISearchChannel GetChannel(string searchTypeName)
        {
            SearchChannel searchChannel = new SearchChannel(this.LoadPreview, this.GetResults, null, this.Dispose);
            searchChannel.ProviderName = searchTypeName;

            return searchChannel;
        }
Example #2
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);
                }
            }
        }
        static InfoService()
        {
            SearchChannel = new SearchChannel();
            SearchChannel.CleanupKey += SearchChannelCleanupKey;
            ChannelEndPoint = new StorageService<string>();
            SearchChannelEndPointA = new AutoCleaningStorageService<string> { Lifetime =  20};
            SearchChannelEndPointB = new AutoCleaningStorageService<string> { Lifetime = 20 };

            //SearchChannelEndPoint = new StorageService<string>();

            ChannelCid = new StorageService<UInt32>();
            IOID = new AutoCleaningStorageService<UInt32> { Lifetime = 10};
            IOID.CleanupKey += IoidCleanupKey;
            ChannelSubscription = new StorageService<UInt32>();
            EchoSent = new AutoCleaningStorageService<IPEndPoint>();
            SubscribedChannel = new StorageService<string>();
        }