mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 03:16:24 +00:00
do not close socket even when it's not in other swarms
This commit is contained in:
parent
b2c2b8f0d0
commit
fe11c695cb
@ -29,15 +29,7 @@ function Swarm (infoHash, server) {
|
|||||||
peer_id: peer.peerId
|
peer_id: peer.peerId
|
||||||
}
|
}
|
||||||
self._onAnnounceStopped(params, peer, 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
|
peer.socket = null
|
||||||
} catch (err) {}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user