File: freePort.Rd

package info (click to toggle)
r-cran-parallelly 1.42.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,216 kB
  • sloc: ansic: 111; sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ports.R
\name{freePort}
\alias{freePort}
\title{Find a TCP port that can be opened}
\usage{
freePort(ports = 1024:65535, default = "random", randomize = TRUE)
}
\arguments{
\item{ports}{(integer vector, or character string)
Zero or more TCP ports in [0, 65535] to scan.
If \code{"random"}, then a random set of ports is considered.
If \code{"auto"}, then the port given by environment variable
\env{R_PARALLEL_PORT} is used, which may also specify \code{random}.}

\item{default}{(integer) \code{NA_integer_} or a port to returned if
an available port could not be found.
If \code{"first"}, then \code{ports[1]}.  If \code{"random"}, then a random port
among \code{ports} is used. If \code{length(ports) == 0}, then \code{NA_integer_}.}

\item{randomize}{(logical) If TRUE, \code{ports} is randomly shuffled
before searched.  This shuffle does \emph{not} forward the RNG seed.}
}
\value{
Returns an integer representing the first port among \code{ports} that
can be opened.  If none can be opened, then \code{default} is returned.
}
\description{
Find a TCP port that can be opened
}