ServerPort
NAME
Test::Util::ServerPort - get a free server port
SYNOPSIS
use Test::Util::ServerPort;
my $port = get-unused-port();
# .. start some server with the port
DESCRIPTION
This is a utility to help with the testing of TCP server software.
It exports a single subroutine get-unused-port
that will return
a port number in the range 1025 - 65535 (or a specified range
as an argument,) that is free to be used by a listening socket. It
checks by attempting to listen
on a random port on the range
until it finds one that is not already bound.