Skip to content

Commit

Permalink
Codechange: remove now unused variable to track if TURN is attempted (#…
Browse files Browse the repository at this point in the history
…32)

The flow is now a bit easier: if either server or client fails
TURN, it falls back to a full connection failed after. No longer
it waits another 2 seconds for any possible other connection methods,
which will never happen anyway.
  • Loading branch information
TrueBrain committed Jul 19, 2021
1 parent 7324ce1 commit 5e7d3a0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions game_coordinator/application/helpers/token_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ async def _timeout(self):

async def _connect(self):
self._connect_next_event = asyncio.Event()
tried_turn = False

while True:
try:
Expand All @@ -90,8 +89,7 @@ async def _connect(self):
# connecting. At this point it is safe to assume there will
# not be any other methods presenting itself. As a last-resort,
# try if TURN is available.
if not tried_turn and self._protocol_version >= 5 and self._application.turn_servers:
tried_turn = True
if self._protocol_version >= 5 and self._application.turn_servers:
connection_string = random.choice(self._application.turn_servers)

# If no STUN request was received, this signal is still set.
Expand Down

0 comments on commit 5e7d3a0

Please sign in to comment.