summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/nested/Client.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2006-12-22 18:52:53 +0000
committerMatthew Newhook <matthew@zeroc.com>2006-12-22 18:52:53 +0000
commit84d9f5c369fceccfa16401ed50783ed2ad209559 (patch)
tree689d30c8707629f1db8155edadb47ce1bce363ad /cpp/demo/Ice/nested/Client.cpp
parentAdded autoflushing of batches (diff)
downloadice-84d9f5c369fceccfa16401ed50783ed2ad209559.tar.bz2
ice-84d9f5c369fceccfa16401ed50783ed2ad209559.tar.xz
ice-84d9f5c369fceccfa16401ed50783ed2ad209559.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1391.
Diffstat (limited to 'cpp/demo/Ice/nested/Client.cpp')
-rw-r--r--cpp/demo/Ice/nested/Client.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/demo/Ice/nested/Client.cpp b/cpp/demo/Ice/nested/Client.cpp
index 53d9ae26547..bc10109a1fe 100644
--- a/cpp/demo/Ice/nested/Client.cpp
+++ b/cpp/demo/Ice/nested/Client.cpp
@@ -13,11 +13,13 @@
using namespace std;
using namespace Demo;
+
class NestedClient : public Ice::Application
{
public:
virtual int run(int, char*[]);
+ virtual void interruptCallback(int);
};
int
@@ -30,6 +32,12 @@ main(int argc, char* argv[])
int
NestedClient::run(int argc, char* argv[])
{
+ //
+ // Since this is an interactive demo we want the custom interrupt
+ // callback to be called when the process is interrupted.
+ //
+ userCallbackOnInterrupt();
+
NestedPrx nested = NestedPrx::checkedCast(communicator()->propertyToProxy("Nested.Client.NestedServer"));
if(!nested)
{
@@ -70,3 +78,27 @@ NestedClient::run(int argc, char* argv[])
return EXIT_SUCCESS;
}
+
+void
+NestedClient::interruptCallback(int)
+{
+/*
+ * For this demo we won't destroy the communicator since it has to
+ * wait for any outstanding invocations to complete which may take
+ * some time if the nesting level is exceeded.
+ *
+ try
+ {
+ communicator()->destroy();
+ }
+ catch(const IceUtil::Exception& ex)
+ {
+ cerr << appName() << ": " << ex << endl;
+ }
+ catch(...)
+ {
+ cerr << appName() << ": unknown exception" << endl;
+ }
+*/
+ exit(EXIT_SUCCESS);
+}