示例#1
0
文件: Dht.cs 项目: mitacha/Kademlia-1
 protected void EvictContact(KBucket bucket, Contact toEvict)
 {
     evictionCount.TryRemove(toEvict.ID.Value, out _);
     Validate.IsTrue <BucketDoesNotContainContactToEvict>(bucket.Contains(toEvict.ID), "Bucket doesn't contain the contact to be evicted.");
     bucket.EvictContact(toEvict);
     ContactRemoved?.Invoke(this, new ContactEventArgs()
     {
         Contact = toEvict
     });
 }
示例#2
0
 public void When(ContactRemoved contactRemoved)
 {
     Deleted = contactRemoved.Deleted;
 }