Skip to main content

bind_command_socket

Function bind_command_socket 

Source
pub fn bind_command_socket(
    path: impl AsRef<Path>,
    mode: u32,
) -> Result<OperatorListener>
Expand description

Bind a command-plane socket: create the parent directory, remove a stale socket left by a prior run (so bind cannot fail with EADDRINUSE), bind, set the file mode, and hand the file to OPERATOR_GROUP. Every accept on the returned listener re-checks the peer (see OperatorListener).

IpcBroadcast::bind and the one-shot command sockets share it so the hygiene and the peer policy live in one place.

Like UnixListener::bind, this must be called from within a Tokio runtime context.