Skip to content

Commit

Permalink
[DEBUG] close trace
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Nov 30, 2023
1 parent 2082cc6 commit 3c8498a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nats-base-client/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ export class ProtocolHandler implements Dispatcher<ParserEvent> {
pendingLimit: number;
lastError?: NatsError;
abortReconnect: boolean;
whyClosed: string;

servers: Servers;
server!: ServerImpl;
Expand All @@ -419,6 +420,7 @@ export class ProtocolHandler implements Dispatcher<ParserEvent> {
this.muxSubscriptions = new MuxSubscription();
this.outbound = new DataBuffer();
this.pongs = [];
this.whyClosed = "";
//@ts-ignore: options.pendingLimit is hidden
this.pendingLimit = options.pendingLimit || this.pendingLimit;
this.features = new Features({ major: 0, minor: 0, micro: 0 });
Expand Down Expand Up @@ -1029,6 +1031,7 @@ export class ProtocolHandler implements Dispatcher<ParserEvent> {
if (this._closed) {
return;
}
this.whyClosed = new Error("close trace").stack || "";
this.heartbeats.cancel();
if (this.connectError) {
this.connectError(err);
Expand Down

0 comments on commit 3c8498a

Please sign in to comment.