Skip to main content

kernel/
networking.rs

1//! # Kernel Networking Module
2//!
3//! This module acts as the central communication hub and TCP server management layer for the
4//! Rektal lighting control kernel. It is responsible for accepting incoming client connections,
5//! enforcing protocol version compatibility, handling secure authentication handshakes, and
6//! maintaining persistent user sessions.
7//!
8//! **Submodule Architecture:**
9//!
10//! * [`connection_engine`] - Manages global thread-safe server state, client session tracking,
11//!   unique connection identifiers, and broadcast routines (such as graceful shutdown announcements).
12//! * [`subscriptions`] - Implements the publish-subscribe pattern, maintaining continuous state
13//!   buffers and dispatching targeted updates (such as DMX configurations) to active clients based
14//!   on their preferred update modes.
15//! * [`server_socket`] - Binds the network socket, orchestrates individual client worker threads,
16//!   and splits streams into independent, asynchronous read and write loops to handle client RPCs,
17//!   CLI commands, and real-time state synchronization.
18mod connection_engine;
19mod server_sockets;
20mod subscriptions;
21
22pub(crate) use server_sockets::activate_socket;
23pub(crate) use subscriptions::on_dmx_config_update;
24pub(crate) use connection_engine::announce_shutdown;