LOGGER.debug("Cannot connect to address {}, skipping.", address);
lastFailure = e;
continue;
}
LOGGER.debug("Connected to address {}.", address);
URI localAddress = new URI(String.format("tcp://localhost:%d", socketChannel.socket().getLocalPort()));
return new SocketConnection<T>(socketChannel, localAddress, destinationUri, classLoader);
}
throw lastFailure;
} catch (java.net.ConnectException e) {
throw new ConnectException(String.format("Could not connect to server %s. Tried addresses: %s.",