diff --git a/transfer_queue/utils/zmq_utils.py b/transfer_queue/utils/zmq_utils.py index 4fe32f0..8960873 100644 --- a/transfer_queue/utils/zmq_utils.py +++ b/transfer_queue/utils/zmq_utils.py @@ -248,7 +248,8 @@ def get_free_port(ip: str) -> int: # in that case just ignore and use the default behavior. pass - sock.bind(("", 0)) + bind_host = "::" if is_ipv6 else "" + sock.bind((bind_host, 0)) return sock.getsockname()[1]