diff options
Diffstat (limited to 'cpp/src/IceStorm/Admin.cpp')
-rw-r--r-- | cpp/src/IceStorm/Admin.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/cpp/src/IceStorm/Admin.cpp b/cpp/src/IceStorm/Admin.cpp index 6377b77c5e9..392d58fea8c 100644 --- a/cpp/src/IceStorm/Admin.cpp +++ b/cpp/src/IceStorm/Admin.cpp @@ -41,12 +41,7 @@ main(int argc, char* argv[]) Ice::InitializationData id; Ice::StringSeq args = Ice::argsToStringSeq(argc, argv); id.properties = Ice::createProperties(args); - // - // We don't want to load DB plug-ins with icestormadmin, as this will - // cause FileLock issues when run with the same configuration file - // used by the service. - // - id.properties->setProperty("Ice.Plugin.DB", ""); + id.properties->setProperty("Ice.Warn.Endpoints", "0"); int rc = app.main(argc, argv, id); return rc; } @@ -157,6 +152,27 @@ Client::run(int argc, char* argv[]) if(!defaultManager) { + string host = properties->getProperty("IceStormAdmin.Host"); + string port = properties->getProperty("IceStormAdmin.Port"); + + const int timeout = 3000; // 3s connection timeout. + ostringstream os; + os << "IceStorm/Finder"; + os << ":tcp" << (host.empty() ? "" : (" -h \"" + host + "\"")) << " -p " << port << " -t " << timeout; + os << ":ssl" << (host.empty() ? "" : (" -h \"" + host + "\"")) << " -p " << port << " -t " << timeout; + IceStorm::FinderPrx finder = IceStorm::FinderPrx::uncheckedCast(communicator()->stringToProxy(os.str())); + try + { + defaultManager = finder->getTopicManager(); + } + catch(const Ice::LocalException&) + { + // Ignore. + } + } + + if(!defaultManager) + { cerr << appName() << ": no manager proxies configured" << endl; return EXIT_FAILURE; } |