Repository navigation
refactor(host): the streaming core is a library too - #23
Merged
Merged
Conversation
The Android app will share its own screen (a Mac shows it), so it needs the
host's sessions, signaling and pairing. crates/host is now lib + bin: lib.rs
exports session, signaling, pairing, screens, timing, probe_page, config and
platform, plus start(HostOptions) -> Host with the wiring main.rs did inline
(session thread, pairing store, signaling listener and web port, the address
to show). main.rs keeps what is the Mac's: flags, AppPaths, the menu bar, the
code dialog, the updater and the viewer.
Signaling's messages to receivers name the host's kind ("Pair this device
with the Mac first") from HostOptions.kind instead of a fixed "Mac".
No behaviour change on the Mac. A taken port is still the "already running"
dialog: start() marks that error with PortInUse.
Checked: 72 tests pass; the lib builds for aarch64-linux-android; the binary
serves /hello and refuses an unpaired device as before.
|
❌ The last analysis has failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is step 1 of letting the tablet share its screen to the Mac. The Android app needs the host's sessions, signaling and pairing. This PR changes nothing on the Mac.
What changed
crates/hostis now a library and a binary.lib.rsexportssession,signaling,pairing,screens,timing,probe_page,configandplatform.start(HostOptions) -> Host, which holds the wiringmain.rsused to do inline: the session thread, the pairing store, the signaling listener and web port, and the address to show.main.rskeeps what is the Mac's: flags, app paths, the menu bar, the pairing-code dialog, the updater and the viewer.HostOptions.kind; the Mac passes "Mac". The Android host will pass "tablet".start()marks that error withPortInUse.The macOS-only dependencies were already target-gated, so building for Android only pulls in the cross-platform crates.
Testing
cargo test: all 72 pass (46 host, 26 proto), the same as ondev.cargo check -p mullion-host --lib --target aarch64-linux-androidbuilds with no errors or warnings./helloanswers;Next: PR 2, the Android host ("Share this screen").