MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / socket_path

Function socket_path

src/orchestrator-process/src/lib.rs:1194–1209  ·  view source on GitHub ↗
(run_dir: &Path, port: &str, process: u16)

Source from the content-addressed store, hash-verified

1192}
1193
1194fn socket_path(run_dir: &Path, port: &str, process: u16) -> String {
1195 let desired = run_dir
1196 .join(format!("{port}-{process}"))
1197 .to_string_lossy()
1198 .into_owned();
1199 if UnixSocketAddr::from_pathname(&desired).is_err() {
1200 // Unix socket addresses have a very low maximum length of around 100
1201 // bytes on most platforms.
1202 env::temp_dir()
1203 .join(hex::encode(Sha1::digest(desired)))
1204 .display()
1205 .to_string()
1206 } else {
1207 desired
1208 }
1209}
1210
1211struct AddressedTcpListener {
1212 listener: TcpListener,

Callers 2

ensure_serviceMethod · 0.85
addressesMethod · 0.85

Calls 6

digestFunction · 0.85
encodeFunction · 0.50
into_ownedMethod · 0.45
joinMethod · 0.45
to_stringMethod · 0.45
displayMethod · 0.45

Tested by

no test coverage detected