/** * Returns a randomly selected available port in the range 5001 to 32767 that satisfies a modulus * * @param protocol The protocol to check (either {@link #SOCKET} or {@link #MULTICAST}). * * @throws IllegalArgumentException <code>protocol</code> is unknown */ public static int getRandomAvailablePortWithMod(int protocol, int mod) { return getRandomAvailablePortWithMod(protocol, getAddress(protocol), mod); }