Skip to content

remote control: fall back to IPv4 when IPv6 bind fails#1832

Draft
Narasimha-sc wants to merge 1 commit into
simplex-chat:masterfrom
Narasimha-sc:nd/rc-listener-ipv4-fallback
Draft

remote control: fall back to IPv4 when IPv6 bind fails#1832
Narasimha-sc wants to merge 1 commit into
simplex-chat:masterfrom
Narasimha-sc:nd/rc-listener-ipv4-fallback

Conversation

@Narasimha-sc

@Narasimha-sc Narasimha-sc commented Jul 20, 2026

Copy link
Copy Markdown

Connecting a mobile to the desktop fails when IPv6 is disabled (simplex-chat/simplex-chat#5515). The remote-host listener binds via startTCPServer … Nothing, which prefers the IPv6 wildcard (::), yet the invitation only advertises an IPv4 address — so when IPv6 is disabled the bind to :: throws and the desktop is unreachable.

This keeps the IPv6-preferring bind and only falls back to 0.0.0.0 when it throws.

Blast radius: confined to startTLSServer (remote-control path) — the shared startTCPServer and the SMP-server transport are untouched. When IPv6 is available the primary bind succeeds and the fallback never runs, so the working path is unchanged. catchAny catches only synchronous exceptions, so an async cancellation during bind still propagates.

The remote-host TLS listener binds via startTCPServer with host=Nothing,
which prefers the IPv6 wildcard (::). The invitation sent to the mobile
device only ever advertises an IPv4 address, so when IPv6 is disabled the
bind to :: throws and the desktop app cannot be reached (issue #5515).

Keep the existing IPv6-preferring bind and only fall back to binding
0.0.0.0 when it fails, so behaviour is unchanged whenever IPv6 is
available and the SMP server transport path is not touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant