String msg = Messages.getString("rmi.log.116") + host + ':' + port //$NON-NLS-1$
                            + ']';
                    if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                        proxyTransportLog.log(RMILog.BRIEF, msg);
                    }
                    throw new NoRouteToHostException(msg);
                }
            } else { // Both direct and HTTP connections are available.
                s = null;
                IOException ex = null;
                try {
                    s = directRsf.createSocket(host, port, (int) connTimeout);
                } catch (IOException ioe) {
                    ex = ioe;
                }
                if (s == null) {
                    // Direct socket attempt failed.
                    if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                        // rmi.log.117=Direct socket connection to [{0}:{1}] failed.
                        proxyTransportLog.log(RMILog.BRIEF, Messages.getString(
                                "rmi.log.117", host, port)); //$NON-NLS-1$
                    }
                    if (ex != null) {
                        if ((eagerHttpFallback
                                && !(ex instanceof SocketException))
                                || (!eagerHttpFallback
                                    && !(ex instanceof UnknownHostException)
                                    && !(ex instanceof NoRouteToHostException))) {
                            throw ex;
                        } else {
                            if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
                                // rmi.log.118=Trying proxy connection to [{1}:{1}].
                                proxyTransportLog.log(RMILog.VERBOSE,
                                        Messages.getString("rmi.log.118", //$NON-NLS-1$
                                        host, port ));
                            } // Falling through to HTTP connection attempt.
                        }
                    } else {
                        // rmi.95=Connection to [{0}:{1}] timed out
                        throw new NoRouteToHostException(Messages.getString("rmi.95", //$NON-NLS-1$
                                host, port));
                    }
                } else if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                    // rmi.log.11A=Direct socket connection to [{0}:{1}] from port {2} succeeded.
                    proxyTransportLog.log(RMILog.BRIEF,
                            Messages.getString("rmi.log.11A", new Object[]{host, port, s.getLocalPort()})); //$NON-NLS-1$
                }
            }
        }
        // Either disableDirectSocket or fallback from direct connection attempt.
        if (s == null) {
            s = proxyRsf.createSocket(proxy, host, port);
            if (s == null) {
                // rmi.log.11B=Proxy connection to [{0}:{1}] failed
                String msg = Messages.getString("rmi.log.11B", host, port); //$NON-NLS-1$
                if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                    proxyTransportLog.log(RMILog.BRIEF, msg);
                }
                throw new NoRouteToHostException(msg);
            }
            if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                // rmi.log.11C=Proxy connection to [{0}:{1}] from port {2} succeeded.
                proxyTransportLog.log(RMILog.BRIEF,Messages.getString("rmi.log.11C", //$NON-NLS-1$