port

fun port(): Int(source)

Returns the port the server is bound to.

The value is available only after start has returned. When the server was created with port = 0 (the default), this returns the ephemeral port assigned by the OS.

Return

The bound port number, e.g. 8080.