refactor: remove port_scanner dependency and simplify port checking logic

This commit is contained in:
Tunglies
2025-12-21 16:51:55 +08:00
parent a5752f7b00
commit af094bfcd7
4 changed files with 3 additions and 14 deletions
+1 -4
View File
@@ -99,8 +99,5 @@ pub fn get_network_interfaces_info() -> CmdResult<Vec<NetworkInterface>> {
#[tauri::command]
pub fn is_port_in_use(port: u16) -> bool {
match TcpListener::bind(("127.0.0.1", port)) {
Ok(_listener) => false,
Err(_) => true,
}
TcpListener::bind(("127.0.0.1", port)).is_err()
}