kill_port 0.1.10

Terminate processes by port cross-platform. 跨平台高效终止端口进程工具。
Documentation
1
2
3
4
5
6
7
8
use std::io;

use kill_tree::blocking::kill_tree;

pub(crate) fn kill_process(pid: u32, _retry: u32) -> io::Result<()> {
  kill_tree(pid)
    .map_err(|err| io::Error::other(format!("Failed to kill process tree {pid}: {err}")))
}