Merge branch 'srv_fix' of https://github.com/lactide/Conversations into lactide-srv_fix
This commit is contained in:
commit
f824193c56
|
@ -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 {
|
||||||
Log.d(Config.LOGTAG, account.getJid()
|
boolean socketError = true;
|
||||||
+ ": using values from dns " + srvRecordServer
|
int srvIndex = 0;
|
||||||
+ ":" + srvRecordPort);
|
while (socketError && namePort.containsKey("name" + srvIndex)){
|
||||||
socket = new Socket(srvRecordServer, srvRecordPort);
|
try {
|
||||||
|
srvRecordServer = namePort.getString("name" + srvIndex);
|
||||||
|
srvRecordPort = namePort.getInt("port" + srvIndex);
|
||||||
|
Log.d(Config.LOGTAG, account.getJid()
|
||||||
|
+ ": using values from dns " + 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))) {
|
||||||
|
|
Loading…
Reference in a new issue