diff --git a/src/component/utils/reconnecter.ts b/src/component/utils/reconnecter.ts index 10aec3f3..df1217ad 100644 --- a/src/component/utils/reconnecter.ts +++ b/src/component/utils/reconnecter.ts @@ -104,6 +104,18 @@ export class Reconnecter extends EventEmitter { return this._last_connected } + public get config(): ReconnecterConfig { + return { ...this._config } + } + + public set config(conf: ReconnecterConfig) { + this._config = { ...conf } + + if (this._config.max_reconnects > this._total_reconnects) { + this.close(new Error('reconnection config changed')) + } + } + public open(): void { if (this._open) { throw new Error('connection is already open')