Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static waitForPortClosed(
port, host = TcpPortScanner.DefaultHost, checkLocalHostAliaes = true,
retryTimeMs = 100, timeOutMs = 5000): Promise {
retryTimeMs = Math.max(retryTimeMs, 1);
if (!TcpPortScanner.shouldUseServerMethod(host)) {
return tcpPortUsed.waitUntilFreeOnHost(port, host, retryTimeMs, timeOutMs);
} else {
const opts = new PortStatusArgs(false, port, host, checkLocalHostAliaes, retryTimeMs, timeOutMs);
return TcpPortScanner.waitForPortStatusEx(opts);
}
}