From 873b482a66e5914ba3dcf85d17fdc94a62457c6a Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 22 Apr 2014 17:44:12 +0200 Subject: Added IceDiscovery service plugin --- cpp/demo/IceDiscovery/hello/Server.cpp | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cpp/demo/IceDiscovery/hello/Server.cpp (limited to 'cpp/demo/IceDiscovery/hello/Server.cpp') diff --git a/cpp/demo/IceDiscovery/hello/Server.cpp b/cpp/demo/IceDiscovery/hello/Server.cpp new file mode 100644 index 00000000000..c68503b398d --- /dev/null +++ b/cpp/demo/IceDiscovery/hello/Server.cpp @@ -0,0 +1,44 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2013 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 +#include + +using namespace std; + +class HelloServer : public Ice::Application +{ +public: + + virtual int run(int, char*[]); +}; + +int +main(int argc, char* argv[]) +{ + HelloServer app; + return app.main(argc, argv, "config.server"); +} + +int +HelloServer::run(int argc, char*[]) +{ + if(argc > 1) + { + cerr << appName() << ": too many arguments" << endl; + return EXIT_FAILURE; + } + + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello"); + Demo::HelloPtr hello = new HelloI; + adapter->add(hello, communicator()->stringToIdentity("hello")); + adapter->activate(); + communicator()->waitForShutdown(); + return EXIT_SUCCESS; +} -- cgit v1.2.3