diff options
-rw-r--r-- | cpp/src/IceDiscovery/LookupI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceDiscovery/PluginI.cpp | 13 | ||||
-rwxr-xr-x | cpp/test/IceDiscovery/simple/run.py | 7 | ||||
-rw-r--r-- | cs/src/IceDiscovery/LookupI.cs | 8 | ||||
-rw-r--r-- | cs/src/IceDiscovery/PluginI.cs | 16 | ||||
-rwxr-xr-x | cs/test/IceDiscovery/simple/run.py | 7 | ||||
-rw-r--r-- | java/src/IceDiscovery/LookupI.java | 8 | ||||
-rw-r--r-- | java/src/IceDiscovery/PluginI.java | 16 | ||||
-rwxr-xr-x | java/test/IceDiscovery/simple/run.py | 7 |
9 files changed, 73 insertions, 17 deletions
diff --git a/cpp/src/IceDiscovery/LookupI.cpp b/cpp/src/IceDiscovery/LookupI.cpp index 01e33ca1a2b..9dd9aa4ce2f 100644 --- a/cpp/src/IceDiscovery/LookupI.cpp +++ b/cpp/src/IceDiscovery/LookupI.cpp @@ -166,7 +166,7 @@ LookupI::findObject(const Ice::AMD_Locator_findObjectByIdPtr& cb, const Ice::Ide if(p->second->addCallback(cb)) { - _lookup->findObjectById(_domainId, id, _lookupReply); + _lookup->begin_findObjectById(_domainId, id, _lookupReply); _timer->schedule(p->second, _timeout); } } @@ -183,7 +183,7 @@ LookupI::findAdapter(const Ice::AMD_Locator_findAdapterByIdPtr& cb, const std::s if(p->second->addCallback(cb)) { - _lookup->findAdapterById(_domainId, adapterId, _lookupReply); + _lookup->begin_findAdapterById(_domainId, adapterId, _lookupReply); _timer->schedule(p->second, _timeout); } } @@ -232,7 +232,7 @@ LookupI::objectRequestTimedOut(const ObjectRequestPtr& request) if(request->retry()) { - _lookup->findObjectById(_domainId, request->getId(), _lookupReply); + _lookup->begin_findObjectById(_domainId, request->getId(), _lookupReply); _timer->schedule(p->second, _timeout); } else @@ -255,7 +255,7 @@ LookupI::adapterRequestTimedOut(const AdapterRequestPtr& request) if(request->retry()) { - _lookup->findAdapterById(_domainId, request->getId(), _lookupReply); + _lookup->begin_findAdapterById(_domainId, request->getId(), _lookupReply); _timer->schedule(p->second, _timeout); } else diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp index 643bc894a2d..01846fb7eab 100644 --- a/cpp/src/IceDiscovery/PluginI.cpp +++ b/cpp/src/IceDiscovery/PluginI.cpp @@ -103,6 +103,19 @@ PluginI::initialize() Ice::ObjectPrx lookupPrx = _communicator->stringToProxy("IceDiscovery/Lookup -d:" + lookupEndpoints); lookupPrx = lookupPrx->ice_collocationOptimized(false); // No collocation optimization for the multicast proxy! + try + { + // Ensure we can establish a connection to the multicast proxy + lookupPrx->ice_getConnection(); + } + catch(const Ice::LocalException& ex) + { + ostringstream os; + os << "unable to establish multicast connection, IceDiscovery will be disabled:\n"; + os << "proxy = " << lookupPrx << '\n'; + os << ex; + throw Ice::PluginInitializationException(__FILE__, __LINE__, os.str()); + } // // Add lookup and lookup reply Ice objects diff --git a/cpp/test/IceDiscovery/simple/run.py b/cpp/test/IceDiscovery/simple/run.py index 1039efa930c..064953914b1 100755 --- a/cpp/test/IceDiscovery/simple/run.py +++ b/cpp/test/IceDiscovery/simple/run.py @@ -29,7 +29,12 @@ args = " --Ice.Plugin.IceDiscovery=IceDiscovery:createIceDiscovery" args += " --IceDiscovery.Timeout=30" args += " --IceDiscovery.RetryCount=1" if TestUtil.ipv6: - args += " --IceDiscovery.Interface=\"::1\"" + # + # Don't set the interface for the multicast datagrams, this doesn't + # work with some Linux distributions (CentOS 6.x) + # + #args += " --IceDiscovery.Address=\"ff15::1:1\" --IceDiscovery.Interface=\"::1\"" + args += " --IceDiscovery.Address=\"ff15::1:1\"" else: args += " --IceDiscovery.Interface=127.0.0.1" diff --git a/cs/src/IceDiscovery/LookupI.cs b/cs/src/IceDiscovery/LookupI.cs index 01efaf0457d..88d68d17ff7 100644 --- a/cs/src/IceDiscovery/LookupI.cs +++ b/cs/src/IceDiscovery/LookupI.cs @@ -215,7 +215,7 @@ namespace IceDiscovery } if(request.addCallback(cb)) { - _lookup.findObjectById(_domainId, id, _lookupReply); + _lookup.begin_findObjectById(_domainId, id, _lookupReply); _timer.schedule(request, _timeout); } } @@ -233,7 +233,7 @@ namespace IceDiscovery } if(request.addCallback(cb)) { - _lookup.findAdapterById(_domainId, adapterId, _lookupReply); + _lookup.begin_findAdapterById(_domainId, adapterId, _lookupReply); _timer.schedule(request, _timeout); } } @@ -284,7 +284,7 @@ namespace IceDiscovery if(request.retry()) { - _lookup.findObjectById(_domainId, request.getId(), _lookupReply); + _lookup.begin_findObjectById(_domainId, request.getId(), _lookupReply); _timer.schedule(request, _timeout); } else @@ -308,7 +308,7 @@ namespace IceDiscovery if(request.retry()) { - _lookup.findAdapterById(_domainId, request.getId(), _lookupReply); + _lookup.begin_findAdapterById(_domainId, request.getId(), _lookupReply); _timer.schedule(request, _timeout); } else diff --git a/cs/src/IceDiscovery/PluginI.cs b/cs/src/IceDiscovery/PluginI.cs index 9525d1ed9f9..652645f0999 100644 --- a/cs/src/IceDiscovery/PluginI.cs +++ b/cs/src/IceDiscovery/PluginI.cs @@ -95,7 +95,21 @@ namespace IceDiscovery Ice.ObjectPrx lookupPrx = _communicator.stringToProxy("IceDiscovery/Lookup -d:" + lookupEndpoints); lookupPrx = lookupPrx.ice_collocationOptimized(false); - + try + { + lookupPrx.ice_getConnection(); + } + catch(Ice.LocalException ex) + { + StringBuilder b = new StringBuilder(); + b.Append("unable to establish multicast connection, IceDiscovery will be disabled:\n"); + b.Append("proxy = "); + b.Append(lookupPrx.ToString()); + b.Append('\n'); + b.Append(ex.ToString()); + throw new Ice.PluginInitializationException(b.ToString()); + } + // // Add lookup and lookup reply Ice objects // diff --git a/cs/test/IceDiscovery/simple/run.py b/cs/test/IceDiscovery/simple/run.py index 95207a0eb0d..955aa65c4ae 100755 --- a/cs/test/IceDiscovery/simple/run.py +++ b/cs/test/IceDiscovery/simple/run.py @@ -34,7 +34,12 @@ if TestUtil.isDarwin() and TestUtil.ipv6: sys.exit(0) if TestUtil.ipv6: - args += " --IceDiscovery.Interface=0:0:0:0:0:0:0:1" + # + # Don't set the interface for the multicast datagrams, this doesn't + # work with some Linux distributions (CentOS 6.x) + # + #args += " --IceDiscovery.Address=\"ff15::1:1\" --IceDiscovery.Interface=\"::1\"" + args += " --IceDiscovery.Address=\"ff15::1:1\"" else: args += " --IceDiscovery.Interface=127.0.0.1" diff --git a/java/src/IceDiscovery/LookupI.java b/java/src/IceDiscovery/LookupI.java index 7d696190614..d71a4e9a217 100644 --- a/java/src/IceDiscovery/LookupI.java +++ b/java/src/IceDiscovery/LookupI.java @@ -229,7 +229,7 @@ class LookupI extends _LookupDisp if(request.addCallback(cb)) { - _lookup.findObjectById(_domainId, id, _lookupReply); + _lookup.begin_findObjectById(_domainId, id, _lookupReply); _timer.schedule(request, _timeout); } } @@ -246,7 +246,7 @@ class LookupI extends _LookupDisp if(request.addCallback(cb)) { - _lookup.findAdapterById(_domainId, adapterId, _lookupReply); + _lookup.begin_findAdapterById(_domainId, adapterId, _lookupReply); _timer.schedule(request, _timeout); } } @@ -292,7 +292,7 @@ class LookupI extends _LookupDisp if(request.retry()) { - _lookup.findObjectById(_domainId, request.getId(), _lookupReply); + _lookup.begin_findObjectById(_domainId, request.getId(), _lookupReply); _timer.schedule(request, _timeout); } else @@ -313,7 +313,7 @@ class LookupI extends _LookupDisp if(request.retry()) { - _lookup.findAdapterById(_domainId, request.getId(), _lookupReply); + _lookup.begin_findAdapterById(_domainId, request.getId(), _lookupReply); _timer.schedule(request, _timeout); } else diff --git a/java/src/IceDiscovery/PluginI.java b/java/src/IceDiscovery/PluginI.java index e78517cb068..9f90c8b251a 100644 --- a/java/src/IceDiscovery/PluginI.java +++ b/java/src/IceDiscovery/PluginI.java @@ -85,7 +85,21 @@ public class PluginI implements Ice.Plugin Ice.ObjectPrx lookupPrx = _communicator.stringToProxy("IceDiscovery/Lookup -d:" + lookupEndpoints); lookupPrx = lookupPrx.ice_collocationOptimized(false); // No collocation optimization for the multicast proxy! - + try + { + lookupPrx.ice_getConnection(); + } + catch(Ice.LocalException ex) + { + StringBuilder b = new StringBuilder(); + b.append("unable to establish multicast connection, IceDiscovery will be disabled:\n"); + b.append("proxy = "); + b.append(lookupPrx.toString()); + b.append('\n'); + b.append(ex.toString()); + throw new Ice.PluginInitializationException(b.toString()); + } + // // Add lookup and lookup reply Ice objects // diff --git a/java/test/IceDiscovery/simple/run.py b/java/test/IceDiscovery/simple/run.py index d23d4644fae..e6e41d07d58 100755 --- a/java/test/IceDiscovery/simple/run.py +++ b/java/test/IceDiscovery/simple/run.py @@ -29,7 +29,12 @@ args = " --Ice.Plugin.IceDiscovery=IceDiscovery:IceDiscovery.PluginFactory" args += " --IceDiscovery.Timeout=30" args += " --IceDiscovery.RetryCount=1" if TestUtil.ipv6: - args += " --IceDiscovery.Interface=\"::1\"" + # + # Don't set the interface for the multicast datagrams, this doesn't + # work with some Linux distributions (CentOS 6.x) + # + #args += " --IceDiscovery.Address=\"ff15::1:1\" --IceDiscovery.Interface=\"::1\"" + args += " --IceDiscovery.Address=\"ff15::1:1\"" else: args += " --IceDiscovery.Interface=127.0.0.1" |