[BUGFIX] happy eyeball: concurrents resolve connect

This commit is contained in:
genofire 2020-02-09 11:38:17 +01:00
parent 9221e482e5
commit 0c410d6cf5
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 3 additions and 2 deletions

View File

@ -277,7 +277,7 @@ public class Resolver {
result = executor.invokeAny(r); result = executor.invokeAny(r);
executor.shutdown(); executor.shutdown();
if (result == null) { if (result == null) {
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball unable to connect to one address"); Log.e(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball unable to connect to one address - this code should not be reachable");
return null; return null;
} }
Thread disconnector = new Thread(() -> { Thread disconnector = new Thread(() -> {
@ -299,7 +299,7 @@ public class Resolver {
Log.e(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball failed: ", e); Log.e(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball failed: ", e);
return null; return null;
} catch (ExecutionException e) { } catch (ExecutionException e) {
Log.e(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball failed: ", e); Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball unable to connect to one address");
return null; return null;
} }
} }
@ -437,6 +437,7 @@ public class Resolver {
if (this.socket != null && this.socket.isConnected()) { if (this.socket != null && this.socket.isConnected()) {
return this ; return this ;
} }
throw new Exception("Resolver.Result was not possible to connect - should be catched by executor");
return null; return null;
} }