public static boolean isPortAvailable(final int port, int protocol) {
    return isPortAvailable(port, protocol, getAddress(protocol));
  }
Returns whether or not the given port on the local host is available (that is, unused).

@param port The port to check
@param protocol The protocol to check (either {@link #SOCKET} or {@link #MULTICAST}).
@throws IllegalArgumentException <code>protocol</code> is unknown
geode-membership/src/main/java/org/apache/geode/internal/membership/utils/AvailablePort.java