summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/interleaved/Server.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-12-02 12:50:07 -0330
committerDwayne Boone <dwayne@zeroc.com>2009-12-02 12:50:07 -0330
commite2b0fa942ac26da6942cb2830e6cedf3ff20e26f (patch)
tree8f60de07c06b46b5e53188b070800016ed5b26b0 /cpp/demo/Ice/interleaved/Server.cpp
parentBug 4398 - enable multi-core support on Windows (diff)
downloadice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.tar.bz2
ice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.tar.xz
ice-e2b0fa942ac26da6942cb2830e6cedf3ff20e26f.zip
Bug 1594 - Added interleaved demo
Diffstat (limited to 'cpp/demo/Ice/interleaved/Server.cpp')
-rwxr-xr-xcpp/demo/Ice/interleaved/Server.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/cpp/demo/Ice/interleaved/Server.cpp b/cpp/demo/Ice/interleaved/Server.cpp
new file mode 100755
index 00000000000..ebe16885733
--- /dev/null
+++ b/cpp/demo/Ice/interleaved/Server.cpp
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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/Ice.h>
+#include <ThroughputI.h>
+
+using namespace std;
+
+class ThroughputServer : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+};
+
+int
+main(int argc, char* argv[])
+{
+ ThroughputServer app;
+ return app.main(argc, argv, "config.server");
+}
+
+int
+ThroughputServer::run(int argc, char* argv[])
+{
+ if(argc > 1)
+ {
+ cerr << appName() << ": too many arguments" << endl;
+ return EXIT_FAILURE;
+ }
+
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Throughput");
+ Demo::ThroughputPtr servant = new ThroughputI;
+ adapter->add(servant, communicator()->stringToIdentity("throughput"));
+ adapter->activate();
+ communicator()->waitForShutdown();
+ return EXIT_SUCCESS;
+}