File: random_port.Rd

package info (click to toggle)
r-cran-pbdzmq 0.3.13%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 856 kB
  • sloc: ansic: 737; sh: 93; pascal: 30; cpp: 6; makefile: 4
file content (44 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/random_port.r
\name{random_port}
\alias{random_port}
\alias{random_open_port}
\title{Random Port}
\usage{
random_port(min_port = 49152, max_port = 65536)

random_open_port(min_port = 49152, max_port = 65536, max_tries = 100)
}
\arguments{
\item{min_port, max_port}{The minimum/maximum value to be generated.  The minimum should not
be below 49152 and the maximum should not exceed 65536 (see
details).}

\item{max_tries}{The maximum number of times a random port will be searched for.}
}
\description{
Generate a valid, random TCP port.
}
\details{
By definition, a TCP port is an unsigned short, and so it can not
exceed 65535.  Additionally, ports in the range 1024 to 49151 are
(possibly) registered by ICANN for specific uses.

\code{random_port()} will simply generate a valid, non-registered
tcp port.  \code{random_unused_port()} will generate a port
that is available for socket connections.

\code{random_open_port()} finds a random port not already bound
to an endpoint.
}
\examples{
random_port()

}
\references{
"The Ephemeral Port Range" by Mike Gleason.  
\url{https://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html}
}
\author{
Drew Schmidt
}