Open TanjaBayer opened 4 years ago
Linking https://github.com/aiortc/aiortc/issues/232
As briefly explained in that issue, I'd propose to fan out gathering. Pseudocode:
tasks = []
for ice_server in ice_servers:
tasks.append(gather_srflx(ice_server, timeout=...))
if ice_server.is_turn:
tasks.append(create_turn_endpoint(ice_server, timeout=...))
results = asyncio.gather(tasks, return_exceptions=True)
<log exceptions, append resulting candidates, only fail if there are no candidates>
Thanks for the suggestion. I'll look into how to correctly do that in the code and provide a PR if I manage it
Hi,
we have a setup where sometimes a STUN server needs to be used (in a company network) and sometimes a TURN server needs to be used (e.g. mobile Hotspot), so we define a STUN server and a TURN server at the same time.
The problem with this setup is, that if we are in the network which blocks the TURN connection, the whole ICE connection failes, because the TURN creat_turn_endpoint raises an error:
A quick fixe for overcoming this issue was to catch the error and to continue with the other servers: In turn.py
create_turn_endpoint
I added:And if the protocol is None, the canditate is just not added: In ice.py
get_component_candidates
But in my opinion that is a dirty fix, as we first need to run into an timeout before beeing able to continue. Do you have any ideas on how to implement this in a proper way? I would also be happy to help with that.