question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'RTCPeerConnection': Cannot create so many PeerConnections

See original GitHub issue

Hello everyone I’m trying to create a multiplayer game in phaser. Once the game has been created i have two player. When i move my player (green) I can see the movement in a new page of my browser (not green). schermata del 2018-07-24 12-44-53 Everything works for the best. But considering that the number of movements is high, after some time you get this error: VM2455:300 Uncaught DOMException: Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections at new WrappedRTCPeerConnection (<anonymous>:300:28) at Object.m._startPeerConnection (http://localhost/SP2P/lib/peer.js:1:33131) at Object.m._getPeerConnection (http://localhost/SP2P/lib/peer.js:1:32849) at Object.m.startConnection (http://localhost/SP2P/lib/peer.js:1:32216) at new d (http://localhost/SP2P/lib/peer.js:1:2579) at p.connect (http://localhost/SP2P/lib/peer.js:1:25072) at PeerClient.conn (http://localhost/SP2P/P2P/PeerClient.js:100:27) at Object.P2PMaze.send (http://localhost/SP2P/js/GameMultiplayer.js:42:29) at P2PMaze.GameMultiplayer.update (http://localhost/SP2P/js/GameMultiplayer.js:236:21) at Phaser.StateManager.update (http://localhost/SP2P/lib/phaser.js:31183:39)

Peerjs Version: 0.3.9 Chrome version: 67.0.3396.62

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
faienz93commented, Jul 26, 2018

I confirm that with the second solution I avoid the error. For this, now I have only two connection:

  • the first: from A to B
  • the second: from B to A The other exchange of data is execute with the same connection. Thank @kidandcat for your support. 👍
1reaction
kidandcatcommented, Jul 25, 2018

The second solution would be much recommended. The first one will give you a lot of troubles because you are creating a lot of connections, one per message, and that will not only lead you to the first error you got from PeerJS, but it will also beat your resources (cpu, ram, network)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot create so many PeerConnections Error #1561 - GitHub
Steps to reproduce the error: Create a js-ipfs instance in the browser, passing no custom opts. Leave it running for 5mins.
Read more >
Exceeding the 500 peer limit in chrome (Cannot create so ...
Im working on a DDoS application to do some testing, and require more than 500 peer connections to be created.
Read more >
825576 - RTCPeerConnection objects are released too slowly ...
Issue 825576 : RTCPeerConnection objects are released too slowly and reallocating causes exception: Cannot create so many PeerConnections.
Read more >
Cannot create so many PeerConnections in erizo.js - Support
I am very new in webrtc and Licode is my first interaction with webrtc. We are trying to set an audio conference in...
Read more >
RTCPeerConnection - Web APIs - MDN Web Docs
Chrome Edge RTCPeerConnection Full support. Chrome56. more. Toggle history Full su... configuration.bundlePolicy parameter Full support. Chrome42. Toggle history Full su... configuration.certificates parameter Full support. Chrome49. Toggle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found