diff --git a/lib/server/swarm.js b/lib/server/swarm.js index d2e1c5f..c8d52cc 100644 --- a/lib/server/swarm.js +++ b/lib/server/swarm.js @@ -20,12 +20,10 @@ function Swarm (infoHash, server) { this.peers.on('evict', function (data) { var peer = data.value if (peer.socket) { - setTimeout(function () { - try { - peer.socket.close() - peer.socket = null - } catch (err) {} - }, 1000) + try { + peer.socket.close() + peer.socket = null + } catch (err) {} } }) } diff --git a/test/server.js b/test/server.js index cc679eb..099b403 100644 --- a/test/server.js +++ b/test/server.js @@ -25,8 +25,7 @@ function serverTest (t, serverType, serverFamily) { : '127.0.0.1' var opts = { - serverType: serverType, - peersCacheLength: 2 + serverType: serverType } common.createServer(t, opts, function (server) {