summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/phonebook/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Client.cpp')
-rw-r--r--cpp/demo/Freeze/phonebook/Client.cpp60
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;
+}