diff options
author | Marc Laukien <marc@zeroc.com> | 2001-09-15 08:13:54 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-09-15 08:13:54 +0000 |
commit | 4cada81a1bf05eb8ea49b09b53fc09deb843bc46 (patch) | |
tree | a2a4f20406a6c841cbc2bc3629c19842f4bc6702 /cpp/demo/Freeze/phonebook/Client.cpp | |
parent | missing .depend (diff) | |
download | ice-4cada81a1bf05eb8ea49b09b53fc09deb843bc46.tar.bz2 ice-4cada81a1bf05eb8ea49b09b53fc09deb843bc46.tar.xz ice-4cada81a1bf05eb8ea49b09b53fc09deb843bc46.zip |
started with phonebook demo
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Client.cpp')
-rw-r--r-- | cpp/demo/Freeze/phonebook/Client.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/cpp/demo/Freeze/phonebook/Client.cpp b/cpp/demo/Freeze/phonebook/Client.cpp new file mode 100644 index 00000000000..4c54ca32eb2 --- /dev/null +++ b/cpp/demo/Freeze/phonebook/Client.cpp @@ -0,0 +1,60 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <PhoneBook.h> + +using namespace std; + +int +run(int argc, char* argv[], Ice::CommunicatorPtr communicator) +{ + Ice::PropertiesPtr properties = communicator->getProperties(); + std::string ref = properties->getProperty("PhoneBook.PhoneBook"); + Ice::ObjectPrx base = communicator->stringToProxy(ref); + + PhoneBookPrx phoneBook = PhoneBookPrx::checkedCast(base); + + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + int status; + Ice::CommunicatorPtr communicator; + + try + { + Ice::PropertiesPtr properties = Ice::createPropertiesFromFile(argc, argv, "config"); + communicator = Ice::initializeWithProperties(properties); + status = run(argc, argv, communicator); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if (communicator) + { + try + { + communicator->destroy(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} |