예제 #1
0
 public FingerTable(BigInteger targetId, BigInteger maxId, IMessageTransceiver transceiver, ChordInstance theInstance, int maxSize = 20, bool reverse = false)
 {
     this.targetId    = targetId;
     this.maxId       = maxId;
     this.maxSize     = maxSize;
     this.transceiver = transceiver;
     this.theInstance = theInstance;
     this.reverse     = reverse;
 }
예제 #2
0
 public Node(IMessageTransceiver transceiver, ChordInstance instance)
 {
     this.transceiver = transceiver;
     this.instance    = instance;
 }
예제 #3
0
        public static ChordInstance CreateChordInstance(byte[] id = null, string tag = "", System.Security.Cryptography.HashAlgorithm hashAlgorithm = null, IMessageTransceiver transceiver = null)
        {
            if (transceiver == null)
                transceiver = new SimpleUDP();
            if (hashAlgorithm == null)
                hashAlgorithm = new System.Security.Cryptography.SHA512Managed();

            ChordInstance i = new ChordInstance(hashAlgorithm, transceiver, id);
            i.tag = tag;

            return i;
        }