Error: cannot signal after peer is destroyed
See original GitHub issueWhat is the proper way to tear down the connection?
I establish a WebRTC connection using a SimplePeer
object, but then I need to drop the connection and reconnect. I call the simplePeer.destroy()
, create a new SimplePeer
object and do the signalling part, but I get the following error:
Error: cannot signal after peer is destroyed
What am I doing wrong? Same issue as this one: https://github.com/feross/simple-peer/issues/101
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Simple-peer. Cannot signal after peer is destroyed
I have simple video chat app which connects 2 peers using WebRTC, Socket.io and ... Uncaught Error: cannot signal after peer is destroyed....
Read more >Uncaught Error: cannot signal after peer is destroyed
Uncaught Error : cannot signal after peer is destroyed.
Read more >simple-peer on.("signal") event repeats many times-webrtc
After resignal, peers wont add to ur array and u'll got ur video stream from ... Error: cannot signal after peer is destroyed...
Read more >Simple-peer NPM | npm.io
Destroy and cleanup this peer connection. If the optional err parameter is passed, then it will be emitted as an 'error' event on...
Read more >PeerJS Documentation
Attempt to reconnect to the server with the peer's old ID. Only disconnected peers can be reconnected. Destroyed peers cannot be reconnected. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I faced the same issue you have to unsubscribe to the socket.io callAccepted listener when peer is closed:
peer.on('close', () => { console.log('peer closed'); socket.off("callAccepted"); });
Do you create new Peer objects on both sides of the connection? Destroying a peer locally will destroy the remote peer it’s connected to.