void (@NotNull HostAndPort hostAndPort, int attemptNumber) { if (isOutdated()) { LOG.info("Opening " + hostAndPort + " aborted"); } else if (canConnect(hostAndPort.getHost(), hostAndPort.getPort())) { openPageNow(); } else if (attemptNumber < myMaximumAttempt) { int delayMillis = getDelayMillis(attemptNumber); LOG.info("#" + attemptNumber + " check " + hostAndPort + " failed, scheduling next check in " + delayMillis + "ms"); checkAndOpenPageLater(hostAndPort, attemptNumber + 1, delayMillis); } else if (attemptNumber == myMaximumAttempt && myOpenOnMaximumAttempt){ LOG.info("#" + attemptNumber + " maximum attempt is reached, page opening is forced"); openPageNow(); } else { LOG.info("#" + attemptNumber + " check " + hostAndPort + " failed. Too many failed checks. Failed to open " + hostAndPort); showBrowserOpenTimeoutNotification(); } }