How to use the tcp-port-used.waitForStatus function in tcp-port-used

To help you get started, we’ve selected a few tcp-port-used examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Marus / cortex-debug / src / tcpportscanner.ts View on Github external
public static waitForPortStatus(
        port, host = TcpPortScanner.DefaultHost, inUse = true,
        checkLocalHostAliaes = true, retryTimeMs = 100, timeOutMs = 5000): Promise {
        retryTimeMs = Math.max(retryTimeMs, 1);
        if (!TcpPortScanner.shouldUseServerMethod(host)) {
            return tcpPortUsed.waitForStatus(port, host, inUse, retryTimeMs, timeOutMs);
        } else {
            const opts = new PortStatusArgs(inUse, port, host, checkLocalHostAliaes, retryTimeMs, timeOutMs);
            return TcpPortScanner.waitForPortStatusEx(opts);
        }
    }

tcp-port-used

A simple Node.js module to check if a TCP port is already bound.

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis