R Under development (unstable) (2024-07-26 r86926 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: 52349 A random free TCP port: 52923 A random free TCP port: 15111 A random free TCP port: 39567 A random free TCP port: 10388 > > > 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: 36510 > > 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.26 0.10 0.35