diff options
Diffstat (limited to 'cpp/demo/IcePack/simple/Server.cpp')
-rw-r--r-- | cpp/demo/IcePack/simple/Server.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/cpp/demo/IcePack/simple/Server.cpp b/cpp/demo/IcePack/simple/Server.cpp new file mode 100644 index 00000000000..ab9d956d157 --- /dev/null +++ b/cpp/demo/IcePack/simple/Server.cpp @@ -0,0 +1,47 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <HelloI.h> + +using namespace std; + +class Server : public Ice::Application +{ +public: + + virtual int run(int argc, char* argv[]); + +}; + +int +Server::run(int argc, char* argv[]) +{ + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello"); + string id = communicator()->getProperties()->getProperty("Identity"); + + Ice::ObjectPtr object = new HelloI; + adapter->add(object, Ice::stringToIdentity(id)); + adapter->activate(); + communicator()->waitForShutdown(); + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + Server app; + int status = app.main(argc, argv); + return status; +} |