availablePort {fame}R Documentation

Find Available TCP Port or Ports In Use

Description

portsInUse returns a vector of UDP and TCP port numbers currently being used by the operating system. Under Linux, these are the ports listed in /proc/net/[u|t]cp, while for Windows they are the ports listed by netstat -an.

Under either operating system, availablePort returns the first TCP port number greater than 40000 that is not currenly in use.

Usage

portsInUse()
availablePort()

Value

portsInUse returns a numeric vector. availablePort returns an integer.

Author(s)

Jeff Hallman

See Also

hostName


[Package fame version 1.09 Index]