@Nullable
    private ServerPort activePort0(@Nullable SessionProtocol protocol) {
        ServerPort candidate = null;
        lock.lock();
        try {
            for (ServerPort serverPort : activePorts.values()) {
                if (protocol == null || serverPort.hasProtocol(protocol)) {
                    if (!isLocalPort(serverPort)) {
                        return serverPort;
                    } else if (candidate == null) {
                        candidate = serverPort;
                    }
                }
            }
        } finally {
            lock.unlock();
        }
        return candidate;
    }
Returns the primary {@link ServerPort} which serves the given {@link SessionProtocol}
that this {@link Server} is listening to. If this {@link Server} has both a local port and
a non-local port, the non-local port is returned.

@return the primary {@link ServerPort}, or {@code null} if there is no active port available for
        the given {@link SessionProtocol}.
core/src/main/java/com/linecorp/armeria/server/Server.java