How to use the tcp-port-used.waitUntilUsedOnHost 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 waitForPortOpen(
        port, host = TcpPortScanner.DefaultHost, checkLocalHostAliaes = true,
        retryTimeMs = 100, timeOutMs = 5000): Promise {
        retryTimeMs = Math.max(retryTimeMs, 1);
        if (!TcpPortScanner.shouldUseServerMethod(host)) {
            return tcpPortUsed.waitUntilUsedOnHost(port, host, retryTimeMs, timeOutMs);
        } else {
            const opts = new PortStatusArgs(true, 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 4 years ago

Package Health Score

67 / 100
Full package analysis