Skip to content

feat: support simultaneous online on custom and builtin rendezvous servers - #3

Open
hashbk wants to merge 2 commits into
masterfrom
feat/dual-server-online
Open

feat: support simultaneous online on custom and builtin rendezvous servers#3
hashbk wants to merge 2 commits into
masterfrom
feat/dual-server-online

Conversation

@hashbk

@hashbk hashbk commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Currently, when a user configures a custom-rendezvous-server via Settings, the client only registers on that custom server, discarding the hardcoded RENDEZVOUS_SERVERS. This PR enables the client to be online on both the user-configured server and the builtin public servers simultaneously, and accept incoming connections from either.

Changes

libs/hbb_common/src/config.rs

  • Config::get_rendezvous_servers(): When custom-rendezvous-server is set, now calls merge_with_builtin_servers() to return the custom server + hardcoded RENDEZVOUS_SERVERS (deduplicated), instead of returning only the custom server.

src/rendezvous_mediator.rs

  • Per-host exit tracking: Replaced the global SHOULD_EXIT cascade with EXITED_HOSTS: Mutex<HashSet<String>>. Only when all hosts have exited or a manual restart is triggered does SHOULD_EXIT get set, so one server disconnecting doesn't kill the other mediator.
  • Per-host PK mismatch tracking: Changed SOLVING_PK_MISMATCH from Mutex<String> to Mutex<HashSet<String>>, allowing independent PK mismatch resolution per host without blocking other hosts from registering.
  • Updated outdated comment in start_tcp.

UI Impact

None. The using_public_server() check remains unchanged — it still returns false when a custom server is configured, preserving existing UI behavior.

Related

  • Depends on: hashbk/hbb_common PR

hashbk added 2 commits July 10, 2026 13:12
…rvers

Enable the client to register on both the hardcoded RENDEZVOUS_SERVERS
and the user-configured custom-rendezvous-server simultaneously, and
accept incoming connections from either server.

Changes:
- Update hbb_common submodule to include get_rendezvous_servers()
  merge logic (custom + builtin servers, deduplicated)
- Replace global SHOULD_EXIT cascade with per-host exit tracking
  (EXITED_HOSTS), so one server disconnecting doesn't kill the other
- Change SOLVING_PK_MISMATCH from Mutex<String> to Mutex<HashSet<String>>
  to allow independent PK mismatch resolution per host
- Update outdated comment in start_tcp
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