Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
profile = "black"

[tool.mypy]
python_version = 3.10
python_version = "3.10"
show_error_context = true
pretty = true
show_column_numbers = true
Expand All @@ -29,7 +29,7 @@ ignore_missing_imports = true

[tool.poetry]
name = "protocol-proxy"
version = "2.0.0rc0"
version = "2.0.0rc2"
description = "A system for launching and communicating with a proxy application for network communication which runs in a separate process.."
authors = ["The VOLTTRON Development Team <volttron@pnnl.gov>"]
license = "Apache License 2.0"
Expand Down
5 changes: 4 additions & 1 deletion src/protocol_proxy/ipc/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ async def _setup_inbound_server(self, socket_params: SocketParams = None):
f' on any port in range: {self.min_port} - {self.max_port}.')
break
else:
self.inbound_params = SocketParams(*self.inbound_server.sockets[0].getsockname())
# Only take first 2 elements (host, port) from getsockname()
# IPv6 sockets return 4-tuple (host, port, flowinfo, scope_id)
sockname = self.inbound_server.sockets[0].getsockname()
self.inbound_params = SocketParams(sockname[0], sockname[1])
break

async def start(self, *_, **__):
Expand Down
5 changes: 4 additions & 1 deletion src/protocol_proxy/proxy/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def __init__(self, manager_address: str, manager_port: int, manager_id: UUID, ma
token=manager_token)

def get_local_socket_params(self) -> SocketParams:
return self.inbound_server.sockets[0].getsockname()
# Only take first 2 elements (host, port) from getsockname()
# IPv6 sockets return 4-tuple (host, port, flowinfo, scope_id)
sockname = self.inbound_server.sockets[0].getsockname()
return SocketParams(sockname[0], sockname[1])

async def send_registration(self, remote: AsyncioProtocolProxyPeer):
_log.debug(f"[send_registration] Attempting to register with manager at: {remote} (type={type(remote)})")
Expand Down