Skip to content

Conversation

@carlogrisetti
Copy link
Contributor

This PR introduces a delay (to be web compliant it cannot be done with dart:io but we have to relay to an async declaration) to allow ICE candidates to be processed by the client.
Without this, I often found myself unable to establish a connection (especially in relay, with the network lag that implicitly happens), because the client just "skipped over" to the next candidate almost immediately, without actually waiting for an established connection.

There might be a better solution, but this solves the issue in all the environments \ networks I was testing this on.

Convert onIceCandidate to async and introduce a delay
@carlogrisetti
Copy link
Contributor Author

This is related to the issues faced in coturn/coturn#814 which were not caused by anything on coturn side, but by this portion of flutter-webrtc-demo code

@cloudwebrtc
Copy link
Member

LGTM

@cloudwebrtc cloudwebrtc merged commit 04e25dc into flutter-webrtc:master Aug 30, 2021
@carlogrisetti carlogrisetti deleted the fix_delayed_ice branch August 30, 2021 08:29
@sven-xie
Copy link

sven-xie commented May 4, 2025

@carlogrisetti I encountered the same problem. I added it according to your method and added a delay, but it didn't work. There is still a one-third probability that the relay fails to establish a connection online. Can you give me some help?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants