1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Move DNS resolving into connect()

It was misplaced in ConnectionConfiguration anyways, as the sole
instantiation of a ConnectionConfiguration should not cause any network
I/O.
This commit is contained in:
Florian Schmaus 2014-03-18 17:29:38 +01:00
parent dbab9b8995
commit d349940537
7 changed files with 56 additions and 64 deletions

View file

@ -420,6 +420,12 @@ public class TCPConnection extends XMPPConnection {
private void connectUsingConfiguration(ConnectionConfiguration config) throws SmackException, IOException {
Exception exception = null;
try {
config.maybeResolveDns();
}
catch (Exception e) {
throw new SmackException(e);
}
Iterator<HostAddress> it = config.getHostAddresses().iterator();
List<HostAddress> failedAddresses = new LinkedList<HostAddress>();
while (it.hasNext()) {