corda / net.corda.testing.core / freePort

freePort

fun freePort(): Int
Deprecated: Returned port is not guaranteed to be free when used, which can result in flaky tests. Instead use a port range that's unlikely to be used by the rest of the system, such as PortAllocation.Incremental(10000).

Returns a free port.

Unsafe for getting multiple ports! Use getFreeLocalPorts for getting multiple ports.