for(ResolvedAddress address : addresses) {
LOG.info("Connecting to XMPP server {} at {}", otherServer, address.getAddress());
connector = createConnector(authenticatedLatch);
ConnectFuture connectFuture = connector.connect(address.getAddress());
if(connectFuture.awaitUninterruptibly(connectTimeout) && connectFuture.isConnected()) {
// success on the TCP/IP level, now wait for the XMPP handshake
try {
if(authenticatedLatch.await(xmppHandshakeTimeout, TimeUnit.MILLISECONDS)) {
// success, break out of connect loop