diff options
Diffstat (limited to 'src/eu/siacs/conversations/utils/DNSHelper.java')
-rw-r--r-- | src/eu/siacs/conversations/utils/DNSHelper.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/eu/siacs/conversations/utils/DNSHelper.java b/src/eu/siacs/conversations/utils/DNSHelper.java index bfab73e0..94dd3b51 100644 --- a/src/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/eu/siacs/conversations/utils/DNSHelper.java @@ -13,6 +13,7 @@ import de.measite.minidns.util.NameUtil; import java.io.IOException; import java.net.InetAddress; +import java.net.SocketTimeoutException; import java.util.ArrayList; import java.util.Collections; import java.util.Random; @@ -162,22 +163,16 @@ public class DNSHelper { i++; } - } catch (IOException e) { - Log.e("xmppService", "io execpiton during dns", e); + } catch (SocketTimeoutException e) { + Log.d("xmppService", "timeout during dns"); namePort.putString("error", "timeout"); + } catch (Exception e) { + Log.d("xmppService","unhandled exception in sub project"); + namePort.putString("error", "unhandled"); } return namePort; } - static int calcPort(byte hb, byte lb) { - int port = ((int) hb << 8) | ((int) lb & 0xFF); - if (port >= 0) { - return port; - } else { - return 65536 + port; - } - } - final protected static char[] hexArray = "0123456789ABCDEF".toCharArray(); public static String bytesToHex(byte[] bytes) { |