Skip to content

Commit

Permalink
Listen to iceconnectionstatechange to clean up client connection map
Browse files Browse the repository at this point in the history
The `close` event in RTCDataChannel is just not being called for some
reason. It does not seem to be due to our code from what I can tell, we
are calling RTCDataChannel.close() but the event is not being fired.

Will want to investigate further before publicly releasing, but it is
behind a flag for now.
  • Loading branch information
jacobmischka committed Dec 7, 2022
1 parent 1e3cbc2 commit 5b3e781
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/classes/IntervalClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ export default class IntervalClient {
)
dcc.peer.onStateChange(state => {
this.#logger.debug('Peer state change:', state)
if (state === 'failed' || state === 'closed') {
if (
state === 'failed' ||
state === 'closed' ||
state === 'disconnected'
) {
this.#dccMap.delete(inputs.id)
}
})
Expand Down

0 comments on commit 5b3e781

Please sign in to comment.