summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-05-28 15:56:00 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-05-28 15:56:00 +0200
commit5bf07bfbf6ffedaa373d23484d141557e778e03a (patch)
treeb3dd1eecdfb62f7735bc25617b48ef3f180ccfa5 /java/src
parentIceGrid/session test doesn't support running with wss (ICE-6539) (diff)
downloadice-5bf07bfbf6ffedaa373d23484d141557e778e03a.tar.bz2
ice-5bf07bfbf6ffedaa373d23484d141557e778e03a.tar.xz
ice-5bf07bfbf6ffedaa373d23484d141557e778e03a.zip
Fixed issue on Android where network operation could occur on main thread (ICE-6521)
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/src/main/java/Ice/ConnectionI.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/java/src/Ice/src/main/java/Ice/ConnectionI.java b/java/src/Ice/src/main/java/Ice/ConnectionI.java
index b593d25c47c..9cc6722421c 100644
--- a/java/src/Ice/src/main/java/Ice/ConnectionI.java
+++ b/java/src/Ice/src/main/java/Ice/ConnectionI.java
@@ -1317,7 +1317,24 @@ public final class ConnectionI extends IceInternal.EventHandler
if(_startCallback != null)
{
- _startCallback.connectionStartFailed(this, _exception);
+ if(_instance.queueRequests())
+ {
+ // The connectStartFailed method might try to connect with another
+ // connector.
+ _instance.getQueueExecutor().executeNoThrow(new Callable<Void>()
+ {
+ @Override
+ public Void call() throws Exception
+ {
+ _startCallback.connectionStartFailed(ConnectionI.this, _exception);
+ return null;
+ }
+ });
+ }
+ else
+ {
+ _startCallback.connectionStartFailed(this, _exception);
+ }
_startCallback = null;
}