Open G-Ray opened 5 years ago
I managed to get around this by using https://github.com/QuantResearch/webrtc-swarm (thanks @QuantResearch). It uses a Math.random value to break the symmetry and I found that it works well. I did not like the floating point numbers in the messages so I made a variation that uses cuid instead (https://github.com/corwin-of-amber/webrtc-swarm).
Disclamer: We use
simple-peer@9.2.1
. The following issue is not visible withsimple-peer <= 9.0.x
, only fromsimple-peer >= 9.1.x
Sometimes, we get 2 peers trying to connect as initiator at same time. Here are the logs:
First peer, in one tab:
Second peer, in other tab:
We are unable to reproduce this issue in tests, but would be great if you have an idea why 2 peers could try to join as iniator at same time ?