pub async fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>Expand description
Bind a Unix domain socket at the given path.
§Security
Attempts to atomically remove stale sockets and bind. However, there’s still a small TOCTOU window. For maximum security, ensure the socket directory is only writable by the daemon process.
§Errors
Returns an error if the socket file cannot be removed or if binding to the provided path fails.