From fe11c695cb4ca759839c94e9f9802c506bc28639 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 21 Feb 2017 01:50:48 -0800 Subject: [PATCH] do not close socket even when it's not in other swarms --- lib/server/swarm.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/server/swarm.js b/lib/server/swarm.js index 773caba..2c6f49a 100644 --- a/lib/server/swarm.js +++ b/lib/server/swarm.js @@ -29,15 +29,7 @@ function Swarm (infoHash, server) { peer_id: peer.peerId } self._onAnnounceStopped(params, peer, peer.peerId) - - // When a websocket peer is evicted, and it's not in any other swarms, close - // the websocket to conserve server resources. - if (peer.socket && peer.socket.infoHashes.length === 0) { - try { - peer.socket.close() - peer.socket = null - } catch (err) {} - } + peer.socket = null }) }