jinroh / kadoh

The Kademlia DHT in Javascript for Node.js and Browsers
http://jinroh.github.com/kadoh
Other
242 stars 31 forks source link

Fixes Issue #63 (Ping bug in debug UI ?) https://github.com/jinroh/kadoh... #65

Closed garyhodgson closed 10 years ago

garyhodgson commented 10 years ago

Fixes Issue #63 (Ping bug in debug UI ?)

alexstrat commented 10 years ago

Exact! I admit that the library can look like a mess and is not easy to tackle, but you did well!

Thanks!

The good way to imitate was in node.js:

var pings = this._bootstraps.map(function(peer) {
  return new PingRPC(peer);
});
this._reactor.sendRPC(pings);
alexstrat commented 10 years ago

Maybe, for convenience, node.js could have implemented an higher level method to send PING request to a given host:

sendPing: function(address) {
  var peer = new BootstrapPeer(address); 
  var rpc = new PingRPC(peer);
  this._reactor.sendRPC(rpc);
  return rpc;
}