[Rd] Specifying (set of random) port numbers for the help HTML server (Was: Re: Fixing html help port in 2.10)
Duncan Murdoch
murdoch at stats.uwo.ca
Sun Oct 18 17:35:08 CEST 2009
On 18/10/2009 11:14 AM, Dieter Menne wrote:
>
>
> Duncan Murdoch-2 wrote:
>>
>> options(help.ports = sample(6800:6850))
>>
>
> Nice. So just in case I want
>
> options(help.ports = sample(6800:6800))
>
> What would be the adverse effects (besides me having to check that that port
> is reasonable)?
That will choose a random port between 1 and 6800, then another, and so
on, potentially trying all 6800.
This is because of the dumb behaviour of sample(6800), nothing to do
with the help system.
If you specify options(help.ports=6800), then R will try to use port
6800. If it happens to be in use by some other process, then it will fail.
If you put this in your startup script, then only the first instance of
R on your system would be able to use HTML help; the others would fail
to start their servers.
If you are on a multi-user system, restricting the range is more likely
to lead to collisions.
There's also the security issue: restricting the range makes it easier
for another user on your system to guess your port. If you are
developing a top secret package, they'll be able to read its help pages
if they know your port number. (They could always do a port scan to
find it, but perhaps your security system would be more likely to detect
that if they had to scan more ports.)
On a single user system I can't see much problem with restricting the
range to a few dozen choices. You're unlikely to have more than a few
instances of R running.
Duncan Murdoch
More information about the R-devel
mailing list