From: Ivailo Hristov Date: Wed, 6 Mar 2024 08:11:46 +0000 (+0200) Subject: Correctly select a free port (#1121) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=97a996055557ea6c4439e37069daf4b5f014f971;p=music-assistant-server.git Correctly select a free port (#1121) Co-authored-by: Ivailo Hristov --- diff --git a/music_assistant/common/helpers/util.py b/music_assistant/common/helpers/util.py index a06cb8a0..13334871 100644 --- a/music_assistant/common/helpers/util.py +++ b/music_assistant/common/helpers/util.py @@ -158,7 +158,7 @@ async def select_free_port(range_start: int, range_end: int) -> int: """Check if port is in use.""" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as _sock: try: - _sock.bind(("127.0.0.1", port)) + _sock.bind(("0.0.0.0", port)) except OSError: return True return False