MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / daemon_socket_state

Function daemon_socket_state

src/daemon/service.rs:501–513  ·  view source on GitHub ↗
(socket_path: &Path)

Source from the content-addressed store, hash-verified

499
500#[cfg(unix)]
501fn daemon_socket_state(socket_path: &Path) -> DaemonSocketState {
502 if !socket_path.exists() {
503 return DaemonSocketState::Missing;
504 }
505 match StdUnixStream::connect(socket_path) {
506 Ok(_) => DaemonSocketState::Connectable,
507 Err(e) if e.kind() == std::io::ErrorKind::ConnectionRefused => DaemonSocketState::Stale,
508 Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
509 DaemonSocketState::PresentNotAccessible
510 }
511 Err(_) => DaemonSocketState::PresentUnreachable,
512 }
513}
514
515#[cfg(not(unix))]
516fn daemon_socket_state(socket_path: &Path) -> DaemonSocketState {

Callers 2

service_statusFunction · 0.85
verify_launchd_startedFunction · 0.85

Calls 2

existsMethod · 0.80
kindMethod · 0.80

Tested by

no test coverage detected