findNextAvailableAsync
Finds an available TCP port on LocalHost starting with the current Port.Ephemeral.value and iterating up limit times.
If Port.Ephemeral.MAX is exceeded while iterating through ports and limit has not been exhausted, the remaining checks will start from Port.Ephemeral.MIN.
Parameters
either LocalHost.IPv4 or LocalHost.IPv6
the number of ports to scan. min: 1, max: 1_000
See also
Throws
if limit is not between 1 and 1_000 (inclusive)
if no ports are available
if underlying coroutine was cancelled
Finds an available TCP port on LocalHost starting with the current Port.Ephemeral.value and iterating up limit times.
If Port.Ephemeral.MAX is exceeded while iterating through ports and limit has not been exhausted, the remaining checks will start from Port.Ephemeral.MIN.
Parameters
either LocalHost.IPv4 or LocalHost.IPv6
the number of ports to scan. min: 1, max: 1_000
Throws
if limit is not between 1 and 1_000 (inclusive)
if no ports are available
if underlying coroutine was cancelled
Finds an available TCP port on LocalHost starting with the current Port.Ephemeral.value and iterating up limit times.
If Port.Ephemeral.MAX is exceeded while iterating through ports and limit has not been exhausted, the remaining checks will start from Port.Ephemeral.MIN.
Parameters
either LocalHost.IPv4 or LocalHost.IPv6
the number of ports to scan. min: 1, max: 1_000
See also
Throws
if limit is not between 1 and 1_000 (inclusive)
if no ports are available
if underlying coroutine was cancelled