Has anyone seen that error, literally:
"Uncaught DOMException: Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections"?
I guess it's happens because I didn't removed connections (maybe not, maybe it's because I didn't provide more memory or something). But from where? Where do they accumulate?
I didn't found answer for the question, literally, nowhere.
I was tried to solve that problem a couple days. By the way, no such thing as a stupid question, right?
UPD: Forgot to add that I using sip.js library.
Has anyone seen that error, literally:
"Uncaught DOMException: Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections"?
I guess it's happens because I didn't removed connections (maybe not, maybe it's because I didn't provide more memory or something). But from where? Where do they accumulate?
I didn't found answer for the question, literally, nowhere.
I was tried to solve that problem a couple days. By the way, no such thing as a stupid question, right?
UPD: Forgot to add that I using sip.js library.
Share Improve this question edited Apr 4, 2018 at 6:46 Alexander Shtang asked Mar 28, 2018 at 11:09 Alexander ShtangAlexander Shtang 1,9594 gold badges16 silver badges24 bronze badges 2- 1 Without a bit more code is difficult to guess where the error may be. There is an answer related to maximum number of RTCPeerConnections stackoverflow./questions/41194545/… – SirPeople Commented Mar 28, 2018 at 11:13
- Possible duplicate of Maximum number of RTCPeerConnection – SirPeople Commented Mar 28, 2018 at 11:14
1 Answer
Reset to default 7Found and fixed the problem. Sip.js library has a .close()
method that closes the peerConnection
. But this is not enough for a garbage collector. Object peerConnection
should be reset to null
.
So, the solving was adding two new lines in library, like
this.mediaHandler.peerConnection = null
and that's it. WebRTC is not crowded and all are happy.