Simple-peer: Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS

Created on 6 Jul 2015  路  5Comments  路  Source: feross/simple-peer

When Trickle ICE is enabled, I get the following error when trying to establish a peer connection between two Chrome browsers on the same machine:

Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS

Disabling Trickle ICE, everything works smoothly.

The code I'm testing with is in a gist: https://gist.github.com/adammw/d9bf021c395835427aa0

need more info

Most helpful comment

Btw, you shouldn't add a new set of event listeners in socket.on('receivePeerSignal', function(data) { because that will get called multiple times with each bit of signaling data and you'll end up handling the 'connec't and 'data' events multiple times.

All 5 comments

What version of node, simple-peer, and which browser are you using? Your example works fine for me.

Make sure you're using the latest simple-peer, version 5.11.3.

Btw, you shouldn't add a new set of event listeners in socket.on('receivePeerSignal', function(data) { because that will get called multiple times with each bit of signaling data and you'll end up handling the 'connec't and 'data' events multiple times.

I'm closing this, as I can't reproduce it. It works for me. If you have new information you can provide to help narrow this down, please comment or open a new issue. Thanks!

@feross yep, I believe my mis-signalling was to blame here. thanks!
For reference I've updated my gist and and confirm it works correctly.

Thanks that actually helped save me on another project I was working on :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimmywarting picture jimmywarting  路  3Comments

scriptonist picture scriptonist  路  5Comments

t-mullen picture t-mullen  路  4Comments

gopchi picture gopchi  路  4Comments

sahil-devzila picture sahil-devzila  路  3Comments