app-engine: protocol §10.6, the lane README and TODO §6

§10.6 records six things the Windows source says that §1-§9 did not:
that a switch moves the pointer only when the target is the local
machine (Helper.cs:75-127), that a Mouse packet addressed to us takes
control back by assignment rather than by switching (Receiver.cs:122-125),
that relative mode puts the edge detection on the controlled machine
(Receiver.cs:147-172), that the reconnect countdown is 30 s and gated on
"no socket established" (frmScreen.cs:425-449), the exact JSON shapes of
the settings file, and why Heartbeat has to be a 64-byte packet.

The README's Handshakes section now documents the API as shipped, six
deliberate deviations, the answers to all eleven open requests from
lanes 3-5, and four new requests: PacketSequencer is used from two
queues and is not thread-safe (session-matrix), PermissionState has no
public initialiser and Cursor publishes no pointer position
(input-capture), and there is no way to send a Heartbeat on demand
(control-channel).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
lucioandClaude Opus 5 committed 2026-09-16 03:35:37 -07:00
1 parent c4741fcfeb
commit fc7a54b40a
5 files changed
+464 -108

No files matched your search

+9 -5
View File
@@ -8,7 +8,8 @@
// from a disconnect callback or a signal handler.
//
// Ported from App/Core/Common.cs `ProcessByeByeMessage` (622-630),
// App/Core/MachineStuff.cs `RemoveDeadMachines` (675-694),
// App/Class/SocketStuff.cs (1561-1563) and App/Core/MachineStuff.cs
// `RemoveDeadMachines` (675-694),
// App/Core/InitAndCleanup.cs `ReleaseAllKeys` (214-243) and `Cleanup` (192-215),
// App/Form/frmScreen.cs `HelperTimer_Tick` (427-461).
@@ -28,10 +29,13 @@ extension Engine {
public func recoverLocal(reason: RecoveryReason) {
routing.routeLocal()
// `SwitchToMachine(MachineName)` is what Windows uses on every one of
// these rows (`Common.cs:626`, `MachineStuff.cs:691`), so control comes
// home the same way a hotkey would: the machine we were driving is told
// to park, and our own pointer lands in the middle of the primary screen.
// `SwitchToMachine(MachineName)` is what Windows does on a `ByeBye`
// (`Common.cs:626`), so control comes home the same way a hotkey would:
// the machine we were driving is told to park, and our own pointer lands
// in the middle of the primary screen. On a plain socket error Windows
// only marks the machine dead (`SocketStuff.cs:1561-1563`) and lets its
// 100 ms timer take control home once nothing is connected
// (`frmScreen.cs:442`); contracts C2 requires it immediately.
var actions: [SwitchAction] = []
if switcher.desMachineID != switcher.localID {
actions = switcher.switchToMachine(named: switcher.localName, now: EventTap.now())