checkPortAvailable(port)

Checks whether the given port is free (not in use).

checkPortAvailable(port)

Parameters

  • port (number) – Port to check.

Return Value

number – 1 if free, 0 if busy.

Example

// example

if (sdk.checkPortAvailable(1080) !== 1) {
  throw new Error("Port is unavailable");
}

Last updated

Was this helpful?