run_ipc_server

Function run_ipc_server 

Source
pub fn run_ipc_server(
    pipe_name: String,
    first: NamedPipeServer,
    ctx: ServerCtx,
) -> JoinHandle<()>
Expand description

Run the named-pipe IPC server until cancelled (or task panics).

Returns a JoinHandle the caller (main.rs) holds for the life of the launcher. The server keeps accepting until the launcher’s Tokio runtime shuts down.

The first pipe instance is passed in pre-bound by the caller (see bind_first_pipe_instance) so a collision can be surfaced synchronously before any children are spawned (Phase B.6).

Each accepted connection becomes a new tokio task running handle_connection. The accept loop creates a fresh NamedPipeServer instance for the next client BEFORE spawning the handler — without this, a slow handler could starve the next connect. Standard Win32 named-pipe pattern.