dispose() { this._ws.removeListener('message', this._messageListener); }
_unbindWsEvents() { this.ws.removeListener(WS_EVENTS.OPEN, this._onOpen); this.ws.removeListener(WS_EVENTS.CLOSE, this._onClose); this.ws.removeListener(WS_EVENTS.ERROR, this._onError); this.ws.removeListener(WS_EVENTS.MESSAGE, this._onMessage); }
send: function (m) { send(m); }, release: function () { if (onError) socket.removeListener('error', onError); if (--refs === 0) socket.terminate(); },
var ws = new WebSocket(wsURI); var removeListener = function () { ws.removeListener('open', waitReady); ws.removeListener('close', waitFail); }; var waitReady = function () { removeListener(); resolve(ws); }; removeListener(); reject(new Error_1.LiveInspectorError("failed to connect to the ws: " + wsURI + ", code: " + code + ", reason: " + reason)); };
var ws = new WebSocket(wsURI); var removeListener = function () { ws.removeListener('open', waitReady); ws.removeListener('close', waitFail); }; var waitReady = function () { removeListener(); resolve(ws); }; removeListener(); reject(new Error_1.LiveInspectorError("failed to connect to the ws: " + wsURI + ", code: " + code + ", reason: " + reason)); };