コード例 #1
0
        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
ファイル: KadHashTable.cs プロジェクト: shayakhmetov94/KadDht
        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();
        }