/** * Returns a randomly selected available port in the provided range. * * @param protocol The protocol to check (either {@link #SOCKET} or {@link #MULTICAST}). * * @throws IllegalArgumentException <code>protocol</code> is unknown */ public static int getAvailablePortInRange(int rangeBase, int rangeTop, int protocol) { return getAvailablePortInRange(protocol, getAddress(protocol), rangeBase, rangeTop); }