Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/rpc/base-channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export class BaseChannel {
});
}

public close() {
this.closeWithReason(undefined);
}

public isClosed() {
return this.closed;
}
Expand All @@ -52,7 +48,7 @@ export class BaseChannel {
return this.closedReason;
}

protected closeWithReason(err?: Error) {
public closeWithReason(err: Error) {
if (this.closed) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/dial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export const dialWebRTC = async (
if (dialOpts?.dialTimeout !== undefined) {
setTimeout(() => {
if (!successful) {
exchange.terminate();
exchange.terminate(new Error('timed out'));
}
}, dialOpts.dialTimeout);
}
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/signaling-exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class SignalingExchange {
.then(() => {
this.exchangeDone = true;
})
.catch(console.error); // eslint-disable-line no-console
.catch(console.error);

// Initiate now the call now that all of our handlers are setup.
const callResponses = this.signalingClient.call(callRequest, this.callOpts);
Expand Down Expand Up @@ -127,8 +127,8 @@ export class SignalingExchange {
}
}

public terminate() {
this.clientChannel.close();
public terminate(err: Error) {
this.clientChannel.closeWithReason(err);
}

private async processCallResponses(
Expand Down