public static KadHashTableConfiguration ForKadHashTable(KadHashTable hashTable)
        {
            KadHashTableConfiguration tableState = new KadHashTableConfiguration();

            tableState.ReplicationCount     = hashTable.ReplicationCount;
            tableState.MaxConcurrentThreads = hashTable.MaxConcurrentThreads;
            tableState.ReplicationInSecs    = hashTable.ReplicationInSecs;
            tableState.RepublicationInSecs  = hashTable.RepublicationInSecs;
            tableState.BucketsRefreshInSecs = hashTable.BucketsRefreshInSecs;

            return(tableState);
        }
示例#2
0
        public KadHashTable(KadNode node, KadContactNode knownNode = null, KadHashTableConfiguration kadHashTableConfig = null)
        {
            Owner = node;
            if (knownNode != null)
            {
                Owner.BucketList.Put(knownNode);
            }

            if (kadHashTableConfig != null)
            {
                ReplicationCount     = kadHashTableConfig.ReplicationCount ?? ReplicationCount;
                MaxConcurrentThreads = kadHashTableConfig.MaxConcurrentThreads ?? MaxConcurrentThreads;
                ReplicationInSecs    = kadHashTableConfig.ReplicationInSecs ?? ReplicationInSecs;
                RepublicationInSecs  = kadHashTableConfig.RepublicationInSecs ?? RepublicationInSecs;
                BucketsRefreshInSecs = kadHashTableConfig.BucketsRefreshInSecs ?? BucketsRefreshInSecs;
            }

            InitTable();
        }