diff --git a/src/centrifuge.ts b/src/centrifuge.ts index 5fb29e62..f25e927b 100644 --- a/src/centrifuge.ts +++ b/src/centrifuge.ts @@ -65,6 +65,7 @@ export class UnauthorizedError extends Error { /** Centrifuge is a Centrifuge/Centrifugo bidirectional client. */ export class Centrifuge extends (EventEmitter as new () => TypedEventEmitter) { state: State; + private _transportIsOpen: boolean; private _endpoint: string | Array; private _emulation: boolean; private _transports: any[]; @@ -111,6 +112,7 @@ export class Centrifuge extends (EventEmitter as new () => TypedEventEmitter, options?: Partial) { super(); this.state = State.Disconnected; + this._transportIsOpen = false; this._endpoint = endpoint; this._emulation = false; this._transports = []; @@ -762,28 +764,11 @@ export class Centrifuge extends (EventEmitter as new () => TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter TypedEventEmitter { + this._centrifuge._call(cmd).then(resolveCtx => { this._inflight = false; // @ts-ignore - improve later. const result = resolveCtx.reply.subscribe; @@ -492,7 +499,7 @@ export class Subscription extends (EventEmitter as new () => TypedEventEmitter