Skip to main content

get_socket

Function get_socket 

Source
pub fn get_socket<'a>(
    socket_name: &'a str,
    mode: &SocketType,
) -> Result<Name<'a>, Error>
Expand description

Attempts to get a socket address for daemon IPC.

ยงExamples

match chilen_ipc::get_socket(
    chilen_ipc::DEFAULT_SOCKET_NAME,
    &chilen_ipc::SocketType::NamespacedOrFilesystem
) {
    Ok(socket) => eprintln!("Got a socket: {socket:?}"),
    Err(e) => panic!("Could not obtain a socket: {e}"),
}