% Generated by roxygen2: do not edit by hand % Please edit documentation in R/app.R \name{random_port} \alias{random_port} \title{Find a random available TCP port} \usage{ random_port(port = 4321L, n = 20L, exclude = NULL, error = TRUE) } \arguments{ \item{port}{Default port to try first.} \item{n}{Number of additional random ports to try.} \item{exclude}{Integer vector of ports to exclude from the search.} \item{error}{Whether to signal an error (default) or return \code{NULL} when no port is found.} } \value{ An integer port number. When \code{error = TRUE} (default), signals an error if no port is found; when \code{error = FALSE}, returns \code{NULL}. } \description{ Find an available TCP port, starting with \code{port}, then sampling from 3000--8000 (excluding ports known to be blocked by Chrome). }