_Moving from email..._
I'm writing to You because I can't find any information on usage of Your module (simple peer) with ICE Trickle set to "true" for faster connection establishment.
At this moment I'm using simple socket.io server for signaling, and I'm able to connect to browsers when ICE Tricke is set to false. I would prefer to use this option for faster connections but I'm not sure how to do this. I think that I may want to use "addIceCandidate()" method on every signal with discovered candidate but there is no such method on "peer" object constructed through Your module.
I would be very gratefull for any kind of help.
You don't need to manually call addIceCandidate(). That's called internally for you when you call peer.signal().
The core difference when you change { trickle: false } to { trickle: true } is that multiple 'signal' events may be emitted from the peer object. Your responsibility is to call peer.signal() on the remote peer whenever the local peer emits a 'signal' event.
The same code can work with trickle enabled or disabled, as long as you're passing every 'signal' event to the remote peer.
@feross - is there a required order of events? For example, since signal() is used for both exchanging SDP's and exchanging ICE candidates must one come before the other?
In my implementation, I noticed the ICE candidates are sent immediately with the offer which means peer.signal(initiator_ice_candidate) will be called before the Answer SDP has been returned to the initiator. I am noticing that once initiator.signal(peer_answer) is called, the next initiator.signal(peer_ice_candidate) call returns error:
Error Error: error adding candidate: Failed to construct 'RTCIceCandidate': parameter 1 ('candidateInitDict') is not an object.
Hey @CiscoKidxx. The order of your signalling events seems fine, but it sounds like some part of your signalling data isn't supported yet. Can you open a new issue and paste the signalling data you are passing into peer.signal() to cause the error?
Most helpful comment
You don't need to manually call
addIceCandidate(). That's called internally for you when you callpeer.signal().The core difference when you change
{ trickle: false }to{ trickle: true }is that multiple'signal'events may be emitted from the peer object. Your responsibility is to callpeer.signal()on the remote peer whenever the local peer emits a'signal'event.The same code can work with trickle enabled or disabled, as long as you're passing every
'signal'event to the remote peer.