} else {
// attempt next
LOG.warn("XMPP handshake with {} at () timed out", otherServer, address.getAddress());
}
} catch (InterruptedException e) {
throw new RemoteServerTimeoutException("Connection to " + otherServer + " was interrupted", e);
}
}
lastException = connectFuture.getException();
LOG.warn("Failed connecting to XMPP server " + otherServer + " at " + address.getAddress(), connectFuture.getException());
connector.dispose();
connector = null;
}
} else {
// should never happen
throw new RemoteServerNotFoundException("DNS lookup of remote server failed");
}
if(!successfullyConnected) {
String exceptionMsg = "Failed to connect to XMPP server at " + otherServer;
if(lastException instanceof UnresolvedAddressException) {
throw new RemoteServerNotFoundException(exceptionMsg);
} else {
throw new RemoteServerTimeoutException(exceptionMsg);
}
}
}