From eae4e5d518d8b258d87f54c3cd35f6d111b42579 Mon Sep 17 00:00:00 2001 From: Rene Treffer Date: Thu, 3 Apr 2014 11:01:20 +0200 Subject: Add ability to use a provided ipv4 address on connect --- src/eu/siacs/conversations/xmpp/XmppConnection.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/eu/siacs/conversations/xmpp') diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 4baf5fae0..3a4668f44 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -129,11 +129,19 @@ public class XmppConnection implements Runnable { return; } String srvRecordServer = namePort.getString("name"); + String srvIpServer = namePort.getString("ipv4"); int srvRecordPort = namePort.getInt("port"); if (srvRecordServer != null) { - Log.d(LOGTAG, account.getJid() + ": using values from dns " + if (srvIpServer != null) { + Log.d(LOGTAG, account.getJid() + ": using values from dns " + + srvRecordServer + "[" + srvIpServer + "]:" + + srvRecordPort); + socket = new Socket(srvIpServer, srvRecordPort); + } else { + Log.d(LOGTAG, account.getJid() + ": using values from dns " + srvRecordServer + ":" + srvRecordPort); - socket = new Socket(srvRecordServer, srvRecordPort); + socket = new Socket(srvRecordServer, srvRecordPort); + } } else { socket = new Socket(account.getServer(), 5222); } -- cgit v1.2.3