Skip to content

Virtualize broker TCP ports - #1150

Open
Weidong Cui (wdcui) wants to merge 5 commits into
uliteboxfrom
wdcui/ulitebox/virtualize-broker-tcp-ports
Open

Virtualize broker TCP ports#1150
Weidong Cui (wdcui) wants to merge 5 commits into
uliteboxfrom
wdcui/ulitebox/virtualize-broker-tcp-ports

Conversation

@wdcui

@wdcui Weidong Cui (wdcui) commented Aug 7, 2026

Copy link
Copy Markdown
Member

This PR gives each broker session an independent guest TCP port namespace, keeps Linux backend endpoints private, and translates session-local TCP connections and accepted peer addresses.

It also establishes the portable TCP publication split: broker core owns publication declarations, reserved guest ports, cross-session claim ownership, monotonic listener generations, and RAII release; the Linux platform owns external endpoint reservation, descriptor realization, epoll integration, stale-connection draining, and tuple translation. Exact claim tokens are retained through listen rollback and teardown so stale generations cannot detach newer listeners.

Production configuration now builds core TcpPortPublication declarations and passes them to LinuxSocketProvider::new_with_tcp_port_publications; UDP remains directly host-backed and the broker protocol version is unchanged.

Give each broker session its own guest TCP port namespace, keep Linux backend endpoints private, route session-local connections through translated host tuples, and add explicit host-to-guest TCP port mappings with reserved endpoint lifecycle handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b5a1a347-37a8-4246-8bbc-306590921475
Bound pending peer translations to live guest-routed connections, retire them with their listener, and preserve exclusive mapped endpoint ownership while clearing stale listener queues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b5a1a347-37a8-4246-8bbc-306590921475
Clear session-local mapped routes when listeners stop, and remove pending peer translations after confirmed connect failure or abortive connector close without changing graceful close-before-accept behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b5a1a347-37a8-4246-8bbc-306590921475
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b5a1a347-37a8-4246-8bbc-306590921475
Move publication declarations, guest-port reservation, claim ownership, and listener generations into broker core while keeping Linux endpoint realization in the platform provider.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b5a1a347-37a8-4246-8bbc-306590921475
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/struct_pub_field_missing.ron

Failed in:
  field local_address of struct AcceptedPlatformSocket, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/7a63b6de36d1f08d757b72103b15801cf997c8a2/litebox_broker_core/src/socket.rs:31

--- failure trait_method_parameter_count_changed: pub trait method parameter count changed ---

Description:
A trait method now takes a different number of parameters.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_method_parameter_count_changed.ron

Failed in:
  PlatformSocket::listen now takes 2 instead of 1 parameters, in file /home/runner/work/litebox/litebox/litebox_broker_core/src/socket.rs:364

--- failure method_parameter_count_changed: pub method parameter count changed ---

Description:
A publicly-visible method now takes a different number of parameters, not counting the receiver (self) parameter.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_parameter_count_changed.ron

Failed in:
  litebox_broker_platform_linux_userland::LinuxSocketProvider::new takes 1 parameters in /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/7a63b6de36d1f08d757b72103b15801cf997c8a2/litebox_broker_platform_linux_userland/src/socket.rs:58, but now takes 2 parameters in /home/runner/work/litebox/litebox/litebox_broker_platform_linux_userland/src/socket.rs:76

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