bittorrent-dht
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -786,2 +786,3 @@ module.exports = DHT | ||
var self = this | ||
if (self._binding) return self.once('listening', self._send.bind(self, addr, message, cb)) | ||
if (!self.listening) return self.listen(self._send.bind(self, addr, message, cb)) | ||
@@ -788,0 +789,0 @@ if (!cb) cb = function () {} |
{ | ||
"name": "bittorrent-dht", | ||
"description": "Simple, robust, BitTorrent DHT implementation", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
@@ -100,1 +100,17 @@ var common = require('./common') | ||
}) | ||
test('send message while binding (listen)', function (t) { | ||
t.plan(1) | ||
var a = new DHT({ bootstrap: false }) | ||
a.listen(function () { | ||
var port = a.address().port | ||
var b = new DHT({ bootstrap: false }) | ||
b.listen() | ||
b._sendPing('127.0.0.1:' + port, function (err) { | ||
t.error(err) | ||
a.destroy() | ||
b.destroy() | ||
}) | ||
}) | ||
}) |
63673
1694