ICE restart in mediasoup

Hi all ,
Could you please tell me how we can determine when we need to restart ICE which work across all the browser, or If ICE becomes disconnected, is it automatically connected internally

I monitor connection state if it disconnects I wait severak seconds to send ice unless user re-connected/etc. So if a user disconnects it is as simple as waiting several seconds allowing re-attempts and sending ice every few seconds till connected. If user is disconnected the server will boot them offline.

Now how you automate the usage of ice is up to you, I am to sorting the best way my self but knowing we must delay it is optimal.

Please read the WebRTC W3 spec where those WebRTC core things are defined and documented. This forum is about mediasoup rather than about WebRTC generic topics.

Thanks for reply
Is transport connection state change events is reliable , and how can we check the current state of ICE in MediaSoup before calling ICE restart ?

Yes the transport’s connectionstatechange is very reliable, the client will know before the host that they
needs ice.

Checking the current state is not necessary, just have the server complete the request and return the ice to the client. If you’re worried about misbehaving clients just throwing ICE out the window ( hahaha) then you could rate-limit this feature. For instance if a room has 24 broadcasts, that could be limited to 48 ice requests a minute. Just an idea.