Merge branch 'srv_fix' of https://github.com/lactide/Conversations into lactide-srv_fix

This commit is contained in:
iNPUTmice 2014-10-19 20:17:12 +02:00
commit f824193c56
1 changed files with 17 additions and 4 deletions

View File

@ -161,10 +161,23 @@ public class XmppConnection implements Runnable {
+ "[" + srvIpServer + "]:" + srvRecordPort); + "[" + srvIpServer + "]:" + srvRecordPort);
socket = new Socket(srvIpServer, srvRecordPort); socket = new Socket(srvIpServer, srvRecordPort);
} else { } else {
boolean socketError = true;
int srvIndex = 0;
while (socketError && namePort.containsKey("name" + srvIndex)){
try {
srvRecordServer = namePort.getString("name" + srvIndex);
srvRecordPort = namePort.getInt("port" + srvIndex);
Log.d(Config.LOGTAG, account.getJid() Log.d(Config.LOGTAG, account.getJid()
+ ": using values from dns " + srvRecordServer + ": using values from dns " + srvRecordServer
+ ":" + srvRecordPort); + ":" + srvRecordPort);
socket = new Socket(srvRecordServer, srvRecordPort); socket = new Socket(srvRecordServer, srvRecordPort);
socketError = false;
} catch (UnknownHostException e) {
srvIndex++;
} catch (IOException e) {
srvIndex++;
}
}
} }
} else if (namePort.containsKey("error") } else if (namePort.containsKey("error")
&& "nosrv".equals(namePort.getString("error", null))) { && "nosrv".equals(namePort.getString("error", null))) {