diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-06 11:05:54 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-06 11:05:54 +0100 |
commit | 542bd45d571c9ca66ef273f6d20c9d86e11faf6c (patch) | |
tree | 8ac07a02d1b6b2849f0d78f6898c80286c5e5f3b | |
parent | Update ubuntu packages to sign icegridgui.jar and version fixes (diff) | |
download | ice-542bd45d571c9ca66ef273f6d20c9d86e11faf6c.tar.bz2 ice-542bd45d571c9ca66ef273f6d20c9d86e11faf6c.tar.xz ice-542bd45d571c9ca66ef273f6d20c9d86e11faf6c.zip |
Fixed Ice discovery plugins to not block on init
-rw-r--r-- | cpp/src/IceDiscovery/PluginI.cpp | 7 | ||||
-rw-r--r-- | cpp/src/IceLocatorDiscovery/PluginI.cpp | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp index 32802631c43..fd4d6dbdf03 100644 --- a/cpp/src/IceDiscovery/PluginI.cpp +++ b/cpp/src/IceDiscovery/PluginI.cpp @@ -107,7 +107,12 @@ PluginI::initialize() try { // Ensure we can establish a connection to the multicast proxy - lookupPrx->ice_getConnection(); + // but don't block. + Ice::AsyncResultPtr result = lookupPrx->begin_ice_getConnection(); + if(result->sentSynchronously()) + { + lookupPrx->end_ice_getConnection(result); + } } catch(const Ice::LocalException& ex) { diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index 2e9b3ef0265..57f27179510 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -214,7 +214,13 @@ PluginI::initialize() lookupPrx = lookupPrx->ice_collocationOptimized(false); // No collocation optimization for the multicast proxy! try { - lookupPrx->ice_getConnection(); // Ensure we can establish a connection to the multicast proxy + // Ensure we can establish a connection to the multicast proxy + // but don't block. + Ice::AsyncResultPtr result = lookupPrx->begin_ice_getConnection(); + if(result->sentSynchronously()) + { + lookupPrx->end_ice_getConnection(result); + } } catch(const Ice::LocalException& ex) { |