Skip to content

Commit

Permalink
set setMaxListeners(Infinity)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Mar 9, 2024
1 parent 68dfcfa commit a3e9dd6
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ObservedCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class ObservedCall<AppData extends Record<string, unknown> = Record<strin
public readonly appData: AppData,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId(): string {
Expand Down
1 change: 1 addition & 0 deletions src/ObservedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str
public readonly appData: AppData
) {
super();
this.setMaxListeners(Infinity);
}

public get clientId(): string {
Expand Down
1 change: 1 addition & 0 deletions src/ObservedDataChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class ObservedDataChannel extends EventEmitter {
public readonly peerConnection: ObservedPeerConnection,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId() {
Expand Down
3 changes: 2 additions & 1 deletion src/ObservedICE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ObservedICE extends EventEmitter {
public readonly peerConnection: ObservedPeerConnection,
) {
super();
this.setMaxListeners(Infinity);
}

public get reports() {
Expand Down Expand Up @@ -147,7 +148,7 @@ export class ObservedICE extends EventEmitter {
if (!candidatePair.nominated) return;

this._stats = candidatePair;

if (
candidatePair.localCandidateId &&
candidatePair.localCandidateId !== this._selectedLocalCandidateId &&
Expand Down
1 change: 1 addition & 0 deletions src/ObservedInboundTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class ObservedInboundTrack<Kind extends MediaKind> extends EventEmitter {
public readonly peerConnection: ObservedPeerConnection,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId() {
Expand Down
1 change: 1 addition & 0 deletions src/ObservedOutboundTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
public readonly peerConnection: ObservedPeerConnection,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId() {
Expand Down
1 change: 1 addition & 0 deletions src/ObservedPeerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class ObservedPeerConnection extends EventEmitter {
public readonly client: ObservedClient,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId() {
Expand Down
1 change: 1 addition & 0 deletions src/ObservedSfu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class ObservedSfu<AppData extends Record<string, unknown> = Record<string
public readonly appData: AppData,
) {
super();
this.setMaxListeners(Infinity);
}

public get serviceId() {
Expand Down
2 changes: 2 additions & 0 deletions src/Observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export class Observer extends EventEmitter {
public readonly config: ObserverConfig,
) {
super();
this.setMaxListeners(Infinity);

logger.debug('Observer is created with config', this.config);
const onNewReport = (collectedReports: number) => {
if (!this.config.maxReports || this._closed) return;
Expand Down

0 comments on commit a3e9dd6

Please sign in to comment.