R Under development (unstable) (2024-12-03 r87418 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: 42537 A random free TCP port: 13917 A random free TCP port: 1631 A random free TCP port: 16564 A random free TCP port: 31169 > > > 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: 27610 > > 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.35 0.12 0.42