diff --git a/src/session.ts b/src/session.ts index 45b20b0..249b8d2 100644 --- a/src/session.ts +++ b/src/session.ts @@ -456,14 +456,13 @@ export class Session extends EventEmitter { } private onClose(): void { - this.teardown(); - if (this.reconnectLoop && !this.reconnectLoop.isStopped()) { + this.teardown(); this.reconnectLoop.schedule(); return; } - this.dlrMerger.clear(); + this.end(); } }