Skip to main content

try_connect_sync

Function try_connect_sync 

Source
pub fn try_connect_sync(socket_path: &Path) -> Result<bool>
Expand description

Synchronously probe whether the daemon socket is reachable.

On Unix: attempts std::os::unix::net::UnixStream::connect. On Windows: checks whether the named-pipe path exists (sufficient for readiness detection without async machinery).

Returns Ok(true) if the socket is reachable, Ok(false) if not.

ยงErrors

Only returns Err for unexpected I/O errors (not ConnectionRefused / NotFound, which are surfaced as Ok(false)).