Fix misassigned default serving server address in adapter client

This commit is contained in:
Drake Aiman 2025-05-21 20:54:26 -07:00
parent f53cba25b3
commit 3ef28441ed
2 changed files with 3 additions and 3 deletions

View file

@ -473,12 +473,12 @@ class Client(components.Component):
'"processId" and "subProcessId" are mutually exclusive'
)
localhost = sockets.get_default_localhost()
if listen != ():
if servers.is_serving():
raise request.isnt_valid(
'Multiple concurrent "listen" sessions are not supported'
)
localhost = sockets.get_default_localhost()
host = listen("host", localhost)
port = listen("port", int)
adapter.access_token = None
@ -486,7 +486,7 @@ class Client(components.Component):
host, port = servers.serve(host, port)
else:
if not servers.is_serving():
servers.serve(host)
servers.serve(localhost)
host, port = servers.listener.getsockname()[:2]
# There are four distinct possibilities here.

View file

@ -18,7 +18,7 @@ def can_bind_ipv4_localhost():
sock.bind(("127.0.0.1", 0))
sock.close()
return True
except (socket.error, OSError):
except (socket.error, OSError, AttributeError):
return False
def can_bind_ipv6_localhost():