Message-ID: <7f87fbfe-456f-ef28-b95a-c6c5d1aabc85@gmail.com>
Date: 2023-01-08T20:05:32Z
From: Daniel Nordlund
Subject: free_port returning only one port...
In-Reply-To: <PU4P216MB156874B71B5E8932902B9064C8F99@PU4P216MB1568.KORP216.PROD.OUTLOOK.COM>
On 1/8/2023 11:35 AM, akshay kulkarni wrote:
> Dear members,
> I am using free_port from the netstat package, but it is returning only one value:
>
>> library(netstat)
>> free_port()
> [1] 14415
>
> This is occurring in both Linux and Windows. Previously it used to output thousands of ports. What has gone wrong?
>
> thanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
I haven't used that function before, and I don't know what you
previously experienced, but if you set the parameter random=TRUE you
will get a different port on each invocation
free_port(random=TRUE)
Hope this is helpful,
Dan
--
Daniel Nordlund
Port Townsend, WA USA
--
This email has been checked for viruses by Avast antivirus software.
www.avast.com