summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/multicast/Server.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-12-13 14:49:32 -0330
committerDwayne Boone <dwayne@zeroc.com>2007-12-13 14:49:32 -0330
commit095ce5674bfa3c48b0cabbc2e37a10c0433a46aa (patch)
tree8c66092204389e83f3e678ff0f12dae45ab567a4 /cpp/demo/Ice/multicast/Server.cpp
parent- Fixes to makemsi.py to support new directory structure. (diff)
downloadice-095ce5674bfa3c48b0cabbc2e37a10c0433a46aa.tar.bz2
ice-095ce5674bfa3c48b0cabbc2e37a10c0433a46aa.tar.xz
ice-095ce5674bfa3c48b0cabbc2e37a10c0433a46aa.zip
Added multicast demo
Diffstat (limited to 'cpp/demo/Ice/multicast/Server.cpp')
-rw-r--r--cpp/demo/Ice/multicast/Server.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/cpp/demo/Ice/multicast/Server.cpp b/cpp/demo/Ice/multicast/Server.cpp
new file mode 100644
index 00000000000..ade188d45db
--- /dev/null
+++ b/cpp/demo/Ice/multicast/Server.cpp
@@ -0,0 +1,43 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 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 <HelloI.h>
+
+using namespace std;
+
+class MulticastServer : public Ice::Application
+{
+public:
+
+ virtual int run(int, char*[]);
+};
+
+int
+main(int argc, char* argv[])
+{
+ MulticastServer app;
+ return app.main(argc, argv, "config.server");
+}
+
+int
+MulticastServer::run(int argc, char* argv[])
+{
+ if(argc > 1)
+ {
+ cerr << appName() << ": too many arguments" << endl;
+ return EXIT_FAILURE;
+ }
+
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
+ adapter->add(new HelloI, communicator()->stringToIdentity("hello"));
+ adapter->activate();
+ communicator()->waitForShutdown();
+ return EXIT_SUCCESS;
+}