Closed
Description
SocketUtils
was introduced in Spring Framework 4.0, primarily to assist in writing integration tests which start an external server on an available random port.
However, these utilities make no guarantee about the subsequent availability of a given port and are therefore unreliable.
Instead of using SocketUtils
to find an available local port for a server, it is recommended that users rely on a server's ability to start on a random port that it selects or is assigned by the operating system. To interact with that server, the user should query the server for the port it is currently using.