R Under development (unstable) (2024-02-13 r85898 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > source("incl/start.R") > > message("*** freePort() ...") *** freePort() ... > > set.seed(42) > rng <- .Random.seed > > for (kk in 1:5) { + port <- freePort() + message("A random free TCP port: ", port) + stopifnot(is.integer(port), length(port) == 1L) + if (!is.na(port)) stopifnot(port >= 0L, port <= 65535L) + stopifnot(identical(.Random.seed, rng)) + } A random free TCP port: 44808 A random free TCP port: 64705 A random free TCP port: 58540 A random free TCP port: 7657 A random free TCP port: 48573 > > > message("- freePort('auto')") - freePort('auto') > > Sys.unsetenv("R_PARALLEL_PORT") > port <- freePort("auto") > message("A random free TCP port: ", port) A random free TCP port: 31845 > > message("- freePort('auto') with env var R_PARALLEL_PORT = 8888") - freePort('auto') with env var R_PARALLEL_PORT = 8888 > Sys.setenv(R_PARALLEL_PORT = 8888L) > port <- freePort("auto") > message("A free TCP port: ", port) A free TCP port: 8888 > stopifnot(port == 8888L) > > > message("*** freePort() ... DONE") *** freePort() ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 0.20 0.12 0.26