GETSOCKET(1) FreeBSD General Commands Manual GETSOCKET(1)

getsocketprint an unused TCP port number

getsocket

The getsocket utility enables tests scrips to spin up temporary services on using a unique TCP port that can be bound to 0.0.0.0.

pg_tmp(1), bind(2), socket(2)

The getsocket utility cannot guarantee the availability of the allocated port since the socket is recycled by the operating system when the utility returns.

Eric Radman <ericshane@eradman.com>

FreeBSD 15.1-STABLE February 6, 2025 GETSOCKET(1)