EVOLUTION-MANAGER
Edit File: randomPort.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Find an open TCP port</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for randomPort {httpuv}"><tr><td>randomPort {httpuv}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find an open TCP port</h2> <h3>Description</h3> <p>Finds a random available TCP port for listening on, within a specified range of ports. The default range of ports to check is 1024 to 49151, which is the set of TCP User Ports. This function automatically excludes some ports which are considered unsafe by web browsers. </p> <h3>Usage</h3> <pre> randomPort(min = 1024L, max = 49151L, host = "127.0.0.1", n = 20) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>min</code></td> <td> <p>Minimum port number.</p> </td></tr> <tr valign="top"><td><code>max</code></td> <td> <p>Maximum port number.</p> </td></tr> <tr valign="top"><td><code>host</code></td> <td> <p>A string that is a valid IPv4 or IPv6 address that is owned by this server, which the application will listen on. <code>"0.0.0.0"</code> represents all IPv4 addresses and <code>"::/0"</code> represents all IPv6 addresses.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Number of ports to try before giving up.</p> </td></tr> </table> <h3>Value</h3> <p>A port that is available to listen on. </p> <h3>Examples</h3> <pre> ## Not run: s <- startServer("127.0.0.1", randomPort(), list()) browseURL(paste0("http://127.0.0.1:", s$getPort())) s$stop() ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>httpuv</em> version 1.5.4 <a href="00Index.html">Index</a>]</div> </body></html>