diff options
author | Marc Laukien <marc@zeroc.com> | 2002-04-03 22:52:39 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-04-03 22:52:39 +0000 |
commit | 96d03c0016f3fb063c77007480171a7785c51c24 (patch) | |
tree | 5c604c07665e48603602da6bc260a53316629e43 /cpp/src/IcePatch/Server.cpp | |
parent | started with IcePatch (diff) | |
download | ice-96d03c0016f3fb063c77007480171a7785c51c24.tar.bz2 ice-96d03c0016f3fb063c77007480171a7785c51c24.tar.xz ice-96d03c0016f3fb063c77007480171a7785c51c24.zip |
more IcePatch work
Diffstat (limited to 'cpp/src/IcePatch/Server.cpp')
-rw-r--r-- | cpp/src/IcePatch/Server.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/cpp/src/IcePatch/Server.cpp b/cpp/src/IcePatch/Server.cpp index 467655e7fa7..10db1b9db92 100644 --- a/cpp/src/IcePatch/Server.cpp +++ b/cpp/src/IcePatch/Server.cpp @@ -69,19 +69,17 @@ IcePatch::Server::run(int argc, char* argv[]) // const char* directoryProperty = "IcePatch.Directory"; string directory = properties->getProperty(directoryProperty); - if (directory.empty()) + if (!directory.empty()) { - cerr << appName() << ": property `" << directoryProperty << "' is not set" << endl; - return EXIT_FAILURE; - } - if(chdir(directory.c_str()) == -1) - { - cerr << appName() << ": can't change to directory `" << directory << "': " << strerror(errno) << endl; - return EXIT_FAILURE; + if (chdir(directory.c_str()) == -1) + { + cerr << appName() << ": can't change to directory `" << directory << "': " << strerror(errno) << endl; + return EXIT_FAILURE; + } } // - // Initialize Object Adapter + // Get the IcePatch endpoints. // const char* endpointsProperty = "IcePatch.Endpoints"; string endpoints = properties->getProperty(endpointsProperty); @@ -90,13 +88,14 @@ IcePatch::Server::run(int argc, char* argv[]) cerr << appName() << ": property `" << endpointsProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectAdapterPtr adapter = communicator()->createObjectAdapterFromProperty("IcePatch", endpointsProperty); // - // Create and add the node locator. + // Create and initialize the object adapter and the node locator. // - ServantLocatorPtr nodeLocator = new NodeLocator; + ObjectAdapterPtr adapter = communicator()->createObjectAdapterFromProperty("IcePatch", endpointsProperty); + ServantLocatorPtr nodeLocator = new NodeLocator(adapter); adapter->addServantLocator(nodeLocator, "IcePatch"); + adapter->activate(); // // We're done, let's wait for shutdown. |