From c763e968c151b9ca1200846948bf9bd022283d7d Mon Sep 17 00:00:00 2001 From: Celve Date: Mon, 1 Apr 2024 16:51:30 +0800 Subject: [PATCH] feat: choose the candidate with minimum RTT --- src/aioice/__init__.py | 2 +- src/aioice/ice.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aioice/__init__.py b/src/aioice/__init__.py index b5de6c4..db1fa45 100644 --- a/src/aioice/__init__.py +++ b/src/aioice/__init__.py @@ -4,7 +4,7 @@ from .ice import Connection, ConnectionClosed, TransportPolicy __all__ = ["Candidate", "Connection", "ConnectionClosed", "TransportPolicy"] -__version__ = "0.9.0.post0" +__version__ = "0.9.0.post1" # Set default logging handler to avoid "No handler found" warnings. logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/src/aioice/ice.py b/src/aioice/ice.py index 45a1a75..4e040b3 100644 --- a/src/aioice/ice.py +++ b/src/aioice/ice.py @@ -668,7 +668,9 @@ def check_complete(self, pair: CandidatePair) -> None: if pair.state == CandidatePair.State.SUCCEEDED: if pair.nominated: - self._nominated[pair.component] = pair + # Always choose the one with minimum RTT + if pair.component not in self._nominated: + self._nominated[pair.component] = pair # 8.1.2. Updating States #