ServerFreePortScanner

Scans for a free port and starts the server on it.

Parameters

server

server to start

Constructors

Link copied to clipboard
constructor(server: Server)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun attemptStartUntilPortAvailable(startingPort: Int, onReady: (Stoppable, port: Int) -> Unit)

Attempts to start the server on a free port. Only a port reported as occupied before onReady starts makes the scan advance: any other failure propagates to the caller instead of being retried on another port.