How to handle "failed" ICE candidate state on the side "receiving" the connection?

5,772 views
Skip to first unread message

Szymon Nowak

unread,
Apr 22, 2014, 4:07:10 PM4/22/14
to discuss...@googlegroups.com
Hey,

when a peer initiates a connection without TURN server and it can't be established, its ICE candidate state changes to "failed" (via "oniceconnectionstatechange" callback). However, the other peer isn't notified about that fact at all. I understand that if RTC connection can't be established, it cannot notify the other peer about this fact. Do I have to manually send a message to the other peer that notifies it about the failed connection attempt?

Cheers,
Szymon

Benjamin Schwartz

unread,
Apr 22, 2014, 4:12:46 PM4/22/14
to discuss...@googlegroups.com
In the event of an ICE connection failure, you will need to perform an ICE restart.  It suffices for one side of your connection to initiate the restart, which includes gathering new candidates and sending them over the signalling channel.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Szymon Nowak

unread,
Apr 22, 2014, 4:43:46 PM4/22/14
to discuss...@googlegroups.com
Thanks! 

If I understand WebRTC specs correctly, iceConnectionState is changed to "failed" if connection can't be established because of lack of STUN or TURN server. In my case (https://www.sharedrop.io) I won't have TURN server, so ICE restart wouldn't help much here and it looks like I'll have to inform about it the other peer via signalling channel.

Benjamin Schwartz

unread,
Apr 22, 2014, 4:48:40 PM4/22/14
to discuss...@googlegroups.com
Yes, without a STUN server, ICE connections will usually fail unless one of the users has a public IP address (or preconfigured port mapping).  This is unusual on the internet today.  I expect that most WebRTC applications will require STUN.

Corey Cole

unread,
Jan 21, 2020, 4:05:39 PM1/21/20
to discuss-webrtc
I'm using dart:html and flutter_webrtc client wrappers which don't support restartIce()

Is it equivalent to close the RtcPeerConnection and start a new one when I get the ice connection failure event?
Reply all
Reply to author
Forward
0 new messages