[R] free_port returning only one port...

Daniel Nordlund djnord|und @end|ng |rom gm@||@com
Sun Jan 8 21:05:32 CET 2023


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 using 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



More information about the R-help mailing list