Skip to content
Open
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
9 changes: 7 additions & 2 deletions tpu_sync/rpc/raiden_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@ def create_server_socket(port: int) -> socket.socket:
"""Creates an IPv6 socket (supporting IPv4 dual-stack on Linux) or falls back to IPv4."""
try:
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
try:
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
except OSError:
# IPv6-only environment (e.g. TI VM under enforced isolation): the
# dual-stack toggle is refused but the v6 socket itself works.
# Keep it and listen v6-only.
pass
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("::", port))
sock.listen(128)
Expand All @@ -364,7 +370,6 @@ def create_server_socket(port: int) -> socket.socket:
sock.listen(128)
return sock


def connect_socket(
address_str: str,
timeout: float = 60.0,
Expand Down
Loading