Choose a random free TCP port.

random_port(lower = 49152L, upper = 65535L)

Arguments

lower

Integer of length 1, lower bound of the port number.

upper

Integer of length 1, upper bound of the port number.

Value

Port number, positive integer of length 1.

Details

This function is a simple wrapper around parallelly::freePort() with the default port range covering ephemeral ports only.

Examples

random_port()
#> [1] 59679