startDynamicHelp
Start the HTML Help System
Description
Starts or stops the dynamic HTTP help server.
Usage
startDynamicHelp(start = TRUE)
Arguments
start |
a logical value. If TRUE (the default), starts the dynamic HTTP
help server. If FALSE, stops the dynamic HTTP help server.
If NA and the help server is not already running, it starts
the help server.
|
Details
When the dynamic HTTP help server is started, it binds to the localhost
interface (that is, it is accessible only from the local machine). The help
server uses the first available port listed in the system option
help.ports, or it uses a random integer between in 10000 and 32000 if
this system option value is NULL. (The port number is stored in the
tools namespace, hidden in the object httpdPort.
The URL at which the dynamic HTTP help server can be accessed is also stored
in the tools namespace, in the object httpdUrl.)
If startDynamicHelp returns -1 as the port
number and displays a text warning, check whether the system environment
variable SNEXT_DISABLE_RDHTTPD is set to a non-empty string, which
disables the dynamic HTTP help server.
An attempt to start a running dynamic HTTP help server, or to stop
a non-running dynamic HTTP help server, causes the function to stop with an
error message.
Value
returns the invisible port number of HTTP dynamic help server. See
Details for more information.
0 | specifies that the HTTP server is stopped. |
-1 | specifies an error or warning has occurred. |
any other positive integer | specifies the port number of a
started HTTP dynamic help server. |
Differences between Spotfire Enterprise Runtime for R and Open-source R
- R does not maintain the server URL in tools:::httpdUrl.
- R uses R_DISABLE_HTTPD instead of TERR_DISABLE_RDHTTPD as the
name of the environment variable to disable starting the HTTP help server.
See Also
Examples
## Not run:
require(tools)
httpd.port <- startDynamicHelp(TRUE)
# starting httpd help server ... done
httpd.port
identical(tools:::httpdPort, httpd.port) # Returns: TRUE
startDynamicHelp() # Error: server already running
startDynamicHelp(FALSE)
tools:::httpdPort # Should be 0
options(help.ports = 12345)
ret <- startDynamicHelp()
ret # Should be 12345
startDynamicHelp(FALSE)
Sys.setenv(SNEXT_DISABLE_RDHTTPD = "yes")
startDynamicHelp()
# Warning in startDynamicHelp() :
# httpd server disabled by SNEXT_DISABLE_RDHTTPD
# [1] -1
## End(Not run)