mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 09:05:17 -07:00
fix docstring for find_voicebox_pid_on_port
This commit is contained in:
@@ -14,10 +14,11 @@ const SERVER_PORT: u16 = 17493;
|
|||||||
|
|
||||||
/// Find a voicebox-server process listening on a given port (Windows only).
|
/// Find a voicebox-server process listening on a given port (Windows only).
|
||||||
///
|
///
|
||||||
/// Uses `TcpListener::bind` to confirm the port is occupied, then falls back
|
/// Uses PowerShell `Get-NetTCPConnection` to look up the PID owning the port,
|
||||||
/// to `tasklist` to scan for a voicebox process. Returns the PID if found.
|
/// then verifies via `tasklist` that it's a voicebox process. The caller is
|
||||||
/// This replaces the previous `netstat -ano` approach which could fail on
|
/// responsible for checking port occupancy first (e.g. `TcpStream::connect_timeout`).
|
||||||
/// systems with corrupted system DLLs (see #277).
|
/// Replaces the previous `netstat -ano` approach which failed on systems with
|
||||||
|
/// corrupted system DLLs (see #277).
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn find_voicebox_pid_on_port(port: u16) -> Option<u32> {
|
fn find_voicebox_pid_on_port(port: u16) -> Option<u32> {
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|||||||
Reference in New Issue
Block a user