run_server

Function run_server 

Source
pub async fn run_server(
    socket_path: &Path,
    stats: Arc<RwLock<DaemonStats>>,
    shutdown_tx: Option<Sender<()>>,
    shutdown_rx: Receiver<()>,
) -> Result<()>
Expand description

Runs the IPC server on the given Unix socket path.

The server listens for incoming connections and processes commands until a shutdown signal is received or the Stop command is sent.

§Arguments

  • socket_path - Path for the Unix domain socket
  • stats - Shared statistics that can be read by clients
  • shutdown_tx - Sender to signal daemon shutdown when Stop is received
  • mut shutdown_rx - Receiver that signals when to stop the server

§Errors

Returns an error if the socket cannot be created or bound.