Skip to content
Permalink
Browse files

Add check for failed connection state

  • Loading branch information...
speekadievs authored and yandeu committed Aug 22, 2019
1 parent 9a91481 commit fb522a6d48b18033cc75e3030c9e4bdaeb2b660f
Showing with 3 additions and 2 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 packages/server/src/wrtc/connectionsManager.ts
@@ -1,3 +1,4 @@
/.idea
package-lock.json
*package-lock.json*
/.vscode
@@ -11,4 +12,4 @@ packages/tests/output
*/common/lib*
*/server/lib*
bundles/test*
*/.tmp/*
*/.tmp/*
@@ -89,7 +89,7 @@ export default class ConnectionsManagerServer {
const pc = connection.peerConnection

pc.onconnectionstatechange = () => {
if (pc.connectionState === 'disconnected') {
if (pc.connectionState === 'disconnected' || pc.connectionState === 'failed') {
connection.channel.eventEmitter.emit(EVENTS.DISCONNECT)
this.deleteConnection(connection)
}

0 comments on commit fb522a6

Please sign in to comment.
You can’t perform that action at this time.