예제 #1
0
 public RoutingTable()
     : this(new Node(NodeId.Create(), new System.Net.IPEndPoint(IPAddress.Any, 0)))
 {
 }
예제 #2
0
 public Bucket(NodeId min, NodeId max)
 {
     this.min = min;
     this.max = max;
 }
 public void Setup()
 {
     manager = new TokenManager();
     node    = new Node(NodeId.Create(), new IPEndPoint(IPAddress.Parse("127.0.0.1"), 25));
     token   = manager.GenerateToken(node);
 }
예제 #4
0
 internal void RaisePeersFound(NodeId infoHash, IList <PeerInfo> peers)
 {
     PeersFound?.Invoke(this, new PeersFoundEventArgs(InfoHash.FromMemory(infoHash.AsMemory()), peers));
 }
예제 #5
0
 internal void RaisePeersFound(NodeId infoHash, IList <Peer> peers)
 {
     PeersFound?.Invoke(this, new PeersFoundEventArgs(new InfoHash(infoHash.Bytes), peers));
 }
예제 #6
0
 public Node(NodeId id, IPEndPoint endpoint)
 {
     this.endpoint = endpoint;
     this.id       = id;
 }