Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ private Process executeGrepProcessCommand(int port) throws IOException {
return Runtime.getRuntime().exec(shell);
}

/**
* @brief The executeGrepProcessWindowCommand function can be used as a replacement for the executeGrepProcessCommand function when running on Windows OS.
*/
private Process executeGrepProcessWindowCommand(int port) throws IOException {
String command = String.format("netstat -an | findstr :%d", port);
String[] shell = {"cmd.exe", "/c", command};
return Runtime.getRuntime().exec(shell);
}

private boolean isRunning(Process process) {
String line;
StringBuilder pidInfo = new StringBuilder();
Expand Down