Skip to main content

kill_by_port

Function kill_by_port 

Source
pub fn kill_by_port(port: u16)
Expand description

Kill any process listening on a TCP port via lsof -ti :$port.

Best-effort – all errors are silently ignored. This is intended as a final safety net to release the port after shutdown, not as a primary kill mechanism.

§Example

use redis_server_wrapper::process;

process::kill_by_port(6379);