Skip to main content

unix_socket_path_is_stale

Function unix_socket_path_is_stale 

Source
pub fn unix_socket_path_is_stale(socket_path: &str) -> bool
Expand description

Source-compatible stale-endpoint helper for filesystem-backed transports. Tells a genuinely orphaned socket path (left behind by a process that exited without cleaning up) apart from a path where a live peer is listening right now — the two look identical to bind (AddrInUse either way). A connect probe distinguishes them: nothing is listening if the connect itself fails to even reach a peer (ConnectionRefused — the classic “orphaned socket file, no listener” signal — or NotFound); any other outcome, including a successful connect, means treat the path as live and leave it alone. Non-filesystem transports return false because they leave no endpoint file to retire.