InetSocketAddress socketAddress = new InetSocketAddress(0);
According javadoc - InetSocketAddress, the used value 0 is documented with
A port number of zero will let the system pick up an ephemeral port in a bind operation.
So just use InetSocketAddress(15684);