Connection Gating
Controlling communication traffic between nodes
Connection Gating
How OctoMY™ gives users explicit control over which types of communication traffic flow between nodes.
Overview
Connection gating provides three independent controls that gate three types of outgoing traffic. This allows users to selectively enable discovery (finding peers), data exchange (courier traffic), and physical transport (per-carrier toggles).
| Control | UI Element | What It Gates |
|---|---|---|
| Honeymoon | Honeymoon button | Discovery broadcasts to find all peers |
| Connect | Connect button | Courier data, handshakes with known peers, keepalives |
| Channel toggles | Per-carrier buttons | All traffic on a specific transport (UDP, Bluetooth, etc.) |
The Control Hierarchy
ConnectionStatusWidget
[Honeymoon] [Connect]
(wantDiscovery) (wantReachable)
[Network] [Bluetooth] [Audio] [Zoo] [NFC]
(per-channel toggles)
Honeymoon (wantDiscovery)
Controls discovery broadcasts — the mechanism for finding ALL peers on the network, both new and previously known.
- When ON: node broadcasts its presence and listens for others
- When OFF: no discovery traffic is sent
- Does NOT affect data exchange with already-connected peers
Connect (wantReachable)
Controls courier data exchange and session re-establishment with known, trusted peers.
- When ON: courier data flows, broken sessions are re-established automatically via handshake
- When ON and a trusted peer's address is unknown or stale: a short, bounded, self-quiescing reconnect burst reacquires the peer (a brief spike of discovery aimed at already-trusted peers, which then goes quiet) — so reconnecting no longer requires the pairing screen
- When OFF: no courier data sent, no handshakes initiated, incoming courier data silently dropped, no reconnect burst
- Handshake responses to incoming SYN packets are always allowed (passive acceptance)
The reconnect burst is deliberately not the Honeymoon control: it targets only peers already trusted, is short-lived and capped, and never enables full peer discovery. Honeymoon remains the explicit, louder "find everyone" control.
Channel Toggles (per-carrier)
Control which physical transport is active. When a channel is OFF, ALL traffic types on that carrier are blocked.
State Combinations
| Connect | Honeymoon | Behavior |
|---|---|---|
| OFF | OFF | Silent. No outgoing traffic. |
| OFF | ON | Discovery broadcasts to find peers. No data exchange, no handshakes initiated. |
| ON | OFF | Data flows to established sessions. Broken sessions re-handshake with known trusted peers. No discovery broadcasts. |
| ON | ON | Full operation: data + re-handshake + discovery. |
Key Semantics
- Independent controls: Connect ON does NOT automatically enable Honeymoon (and vice versa)
- Honeymoon finds ALL peers (new and known). Connect only re-establishes with KNOWN TRUSTED peers.
- Automatic re-handshake: When Connect is ON and a session breaks, the node re-handshakes automatically. This is connection maintenance, not discovery.
- Passive acceptance: Even with Connect OFF, the node responds to incoming handshake requests. This allows a peer with Connect ON to establish a session.
Implementation Architecture
Connection gating is implemented through the ReachableState class, which lives in libpair and is shared with Comms in libcomms.
libpair (ReachableState) <-- no dependency on libcomms
libcomms (Comms, CommsChannel) --> depends on libpair
Comms::configure() wires commsConnectionStatusChanged -> ReachableState::setNetworkConnected()
Where Gating Is Enforced
| Location | What Is Gated |
|---|---|
CommsChannel::rescheduleSending() |
Courier data scheduling |
CommsChannel::recieveHandshake() |
Incoming handshake processing |
CommsChannel::onCarrierSendingOpportunity() |
Outgoing courier data |
DiscoveryClient activation |
Discovery broadcast traffic |
Currently Supported Carriers
| Carrier | Status | Gating |
|---|---|---|
| UDP | Implemented | Full gating via wantReachable + channel toggle |
| Bluetooth | Stub | Channel toggle placeholder |
| Audio | Stub | Channel toggle placeholder |
| Zoo (mesh relay) | Stub | Channel toggle placeholder |
| NFC | Stub | Channel toggle placeholder |