diff options
author | Benoit Foucher <benoit@zeroc.com> | 2004-02-20 21:32:15 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2004-02-20 21:32:15 +0000 |
commit | 69a05e28e0702e5fd96ff012c64dcf72847818fa (patch) | |
tree | d560b8285964520c820ca29b2dd1f7600d5ea725 /cpp/demo/IcePack/simple/Server.cpp | |
parent | more ami (diff) | |
download | ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.bz2 ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.tar.xz ice-69a05e28e0702e5fd96ff012c64dcf72847818fa.zip |
Fixed IcePack node bug and IcePack hello demo, added simple demo.
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; +} |