Nothing
get_free_port <- function(port = 6000) {
while (TRUE) {
p <- callr::r_bg(
function(port) {
inherits(try(
socketConnection(port = port, server = TRUE), silent = TRUE),
"connection")
},
list(port = port))
q <- callr::r_bg(
function(port) {
Sys.sleep(0.1)
inherits(try(
socketConnection(port = port, server = FALSE), silent = TRUE),
"connection")
},
list(port = port))
q$wait()
p$wait()
if (q$get_result() && p$get_result()) {
return(port)
} else {
port <- port + 1
}
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.