[BUGFIX] happy eyeball: concurrents resolve connect
This commit is contained in:
parent
c3da4be4da
commit
afcfd057d8
1 changed files with 2 additions and 6 deletions
|
@ -282,10 +282,6 @@ public class Resolver {
|
||||||
try {
|
try {
|
||||||
result = executor.invokeAny(r);
|
result = executor.invokeAny(r);
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
if (result == null) {
|
|
||||||
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": happy eyeball unable to connect to one address");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Thread disconnector = new Thread(() -> {
|
Thread disconnector = new Thread(() -> {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
@ -307,7 +303,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -447,7 +443,7 @@ public class Resolver {
|
||||||
if (this.socket != null && this.socket.isConnected()) {
|
if (this.socket != null && this.socket.isConnected()) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return null;
|
throw new Exception("Resolver.Result was not possible to connect - should be catched by executor");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentValues toContentValues() {
|
public ContentValues toContentValues() {
|
||||||
|
|
Reference in a new issue