remove unneeded timeout

This commit is contained in:
Feross Aboukhadijeh 2017-02-02 20:28:38 -08:00
parent 1b22b53fe8
commit 29d4564bbd
2 changed files with 5 additions and 8 deletions

View File

@ -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) {}
}
})
}

View File

@ -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) {