IPv6 support (#1896)

* Add initial support for IPv6

* address comments (part 1)

* quick clean up of missed fix suggestion

* Fix misassigned default serving server address in adapter client

* add wrapper method to get host and port from`getsockname`
This commit is contained in:
rabbit 2025-05-22 13:04:11 -07:00 committed by GitHub
parent 4bc7343c05
commit 34d5de99a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 123 additions and 50 deletions

View file

@ -25,7 +25,7 @@ class BackChannel(object):
def listen(self):
self._server_socket = sockets.create_server("127.0.0.1", 0, self.TIMEOUT)
_, self.port = self._server_socket.getsockname()
_, self.port = sockets.get_address(self._server_socket)
self._server_socket.listen(0)
def accept_worker():

View file

@ -464,7 +464,8 @@ class Session(object):
self.expected_adapter_sockets["client"]["port"] = port
sock = sockets.create_client()
ipv6 = host.count(":") > 1
sock = sockets.create_client(ipv6)
sock.connect(address)
stream = messaging.JsonIOStream.from_socket(sock, name=self.adapter_id)