aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-02-08 21:35:42 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-02-08 21:35:42 +0100
commitd2e1e316fc15674daccc79b99438b3ac37c7d61d (patch)
tree848b822fcf9e8fbb67fe2395f5b559dbce7cb64e
parent56a0760fbbe01cf7495a5b5be80fffe01ccf3fc3 (diff)
add more logging and fix typo in Resolver.java
-rw-r--r--src/main/java/de/pixart/messenger/utils/Resolver.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Resolver.java b/src/main/java/de/pixart/messenger/utils/Resolver.java
index 4eb42db7e..666ec37ec 100644
--- a/src/main/java/de/pixart/messenger/utils/Resolver.java
+++ b/src/main/java/de/pixart/messenger/utils/Resolver.java
@@ -151,6 +151,7 @@ public class Resolver {
}
}
} catch (InterruptedException e) {
+ e.printStackTrace();
for (Thread thread : threads) {
thread.interrupt();
}
@@ -168,6 +169,7 @@ public class Resolver {
result.port = port;
return result;
} catch (UnknownHostException e) {
+ e.printStackTrace();
return null;
}
}
@@ -201,6 +203,7 @@ public class Resolver {
try {
thread.join();
} catch (InterruptedException e) {
+ e.printStackTrace();
return Collections.emptyList();
}
}
@@ -274,7 +277,7 @@ public class Resolver {
return result;
}
- ExecutorService executor = (ExecutorService) Executors.newFixedThreadPool(4);
+ ExecutorService executor = Executors.newFixedThreadPool(4);
try {
result = executor.invokeAny(r);
@@ -288,7 +291,9 @@ public class Resolver {
try {
if (executor.awaitTermination(5, TimeUnit.SECONDS)) break;
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball wait for cleanup ...");
- } catch (InterruptedException e) {}
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
}
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball cleanup");
for (Result re : r) {
@@ -391,7 +396,7 @@ public class Resolver {
public String toString() {
return "Result{" +
"ip='" + (ip == null ? null : ip.getHostAddress()) + '\'' +
- ", hostame='" + (hostname == null ? null : hostname.toString()) + '\'' +
+ ", hostname='" + (hostname == null ? null : hostname.toString()) + '\'' +
", port=" + port +
", directTls=" + directTls +
", authenticated=" + authenticated +
@@ -411,6 +416,7 @@ public class Resolver {
time = System.currentTimeMillis() - time;
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": Result connect: " + toString() + " after: " + time + " ms");
} catch (IOException e) {
+ e.printStackTrace();
this.disconnect();
}
}