[SA-1536] Dont send STUN binding req with turn #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From what I can tell, the turn server stops being contactable after 10mins which causes these STUN BINDING requests to fail and causes the ICE state to be set to disconnected. I have tested this locally by just not sending these BINDING requests when using the TURN client instead of the STUN client and was live for an hour before the bumper rolled - which indicates that they're not necessary. This will only affect TURN PC's and has no impact on STUN PC's
NOTE: all I've done to the below code is add the
if (pair?.protocol?.type !== "turn") {
condition around what's already thereGiven this is not actually a fix for whatever is causing the turn server to become uncontactable - I am not requesting this code gets merged into the shinyoshiaki repo