From 811e2eaeecf868b5d58a5d759d01ed264f5cd0bc Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 10 Sep 2015 10:54:15 +0200 Subject: increased dns timeout --- src/main/java/eu/siacs/conversations/Config.java | 2 +- src/main/java/eu/siacs/conversations/utils/DNSHelper.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 2b84e75e..6b57f7ea 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -15,7 +15,7 @@ public final class Config { public static final int PING_MAX_INTERVAL = 300; public static final int PING_MIN_INTERVAL = 30; - public static final int PING_TIMEOUT = 10; + public static final int PING_TIMEOUT = 15; public static final int SOCKET_TIMEOUT = 15; public static final int CONNECT_TIMEOUT = 90; public static final int CARBON_GRACE_PERIOD = 90; diff --git a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java index 2cde19ae..70bc7360 100644 --- a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java @@ -84,6 +84,7 @@ public class DNSHelper { public static Bundle queryDNS(String host, InetAddress dnsServer) { Bundle bundle = new Bundle(); try { + client.setTimeout(Config.PING_TIMEOUT * 1000); String qname = "_xmpp-client._tcp." + host; Log.d(Config.LOGTAG, "using dns server: " + dnsServer.getHostAddress() + " to look up " + host); DNSMessage message = client.query(qname, TYPE.SRV, CLASS.IN, dnsServer.getHostAddress()); -- cgit v1.2.3