diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index b0aa6b5..3cd7d1f 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -169,12 +169,12 @@ WebSocketTracker.prototype._openSocket = function () { } else { self.socket = socketPool[self.announceUrl] = new Socket(self.announceUrl) self.socket.consumers = 1 - self.socket.on('connect', self._onSocketConnectBound) + self.socket.once('connect', self._onSocketConnectBound) } self.socket.on('data', self._onSocketDataBound) - self.socket.on('close', self._onSocketCloseBound) - self.socket.on('error', self._onSocketErrorBound) + self.socket.once('close', self._onSocketCloseBound) + self.socket.once('error', self._onSocketErrorBound) } WebSocketTracker.prototype._onSocketConnect = function () {