summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/bidir/Server.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-02-05 18:22:55 +0000
committerMarc Laukien <marc@zeroc.com>2005-02-05 18:22:55 +0000
commit0ac9eb8d52a88ac89b7118f99902636b8f13d414 (patch)
treee1e50870cf3208b666637ddf2fba8a240bb00784 /cpp/demo/Ice/bidir/Server.cpp
parentremoving call to startSeq/endSeq for sequence of fixed-length type (diff)
downloadice-0ac9eb8d52a88ac89b7118f99902636b8f13d414.tar.bz2
ice-0ac9eb8d52a88ac89b7118f99902636b8f13d414.tar.xz
ice-0ac9eb8d52a88ac89b7118f99902636b8f13d414.zip
connection->setAdapter and bidir demo
Diffstat (limited to 'cpp/demo/Ice/bidir/Server.cpp')
-rw-r--r--cpp/demo/Ice/bidir/Server.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/cpp/demo/Ice/bidir/Server.cpp b/cpp/demo/Ice/bidir/Server.cpp
new file mode 100644
index 00000000000..56cfe1529ec
--- /dev/null
+++ b/cpp/demo/Ice/bidir/Server.cpp
@@ -0,0 +1,52 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Application.h>
+#include <CallbackI.h>
+
+using namespace std;
+using namespace Ice;
+using namespace Demo;
+
+class CallbackServer : public Application
+{
+public:
+
+ virtual int run(int, char*[]);
+};
+
+int
+main(int argc, char* argv[])
+{
+ CallbackServer app;
+ return app.main(argc, argv, "config");
+}
+
+int
+CallbackServer::run(int argc, char* argv[])
+{
+ ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Callback.Server");
+ CallbackSenderIPtr sender = new CallbackSenderI;
+ adapter->add(sender, Ice::stringToIdentity("sender"));
+ adapter->activate();
+
+ sender->start();
+ try
+ {
+ communicator()->waitForShutdown();
+ }
+ catch(...)
+ {
+ sender->destroy();
+ throw;
+ }
+ sender->destroy();
+
+ return EXIT_SUCCESS;
+}