diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-11-16 16:39:46 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-11-16 16:39:46 +0000 |
commit | 9884f1a62746e6945a17908f62600f619e69163f (patch) | |
tree | 8a67e40ac77e4405c59872bfeb44753d8ac8f6d3 /cpp/demo/Ice/async/Server.cpp | |
parent | Rmeove /opt/Ice-Ver symbolic link if created (diff) | |
download | ice-9884f1a62746e6945a17908f62600f619e69163f.tar.bz2 ice-9884f1a62746e6945a17908f62600f619e69163f.tar.xz ice-9884f1a62746e6945a17908f62600f619e69163f.zip |
Added async demo
Diffstat (limited to 'cpp/demo/Ice/async/Server.cpp')
-rw-r--r-- | cpp/demo/Ice/async/Server.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cpp/demo/Ice/async/Server.cpp b/cpp/demo/Ice/async/Server.cpp new file mode 100644 index 00000000000..bc4ecadf287 --- /dev/null +++ b/cpp/demo/Ice/async/Server.cpp @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2006 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 <QueueI.h> +#include <Ice/Application.h> + +using namespace std; + +class QueueServer : public Ice::Application +{ +public: + + virtual int run(int, char*[]); +}; + +int +main(int argc, char* argv[]) +{ + QueueServer app; + return app.main(argc, argv, "config.server"); +} + +int +QueueServer::run(int argc, char* argv[]) +{ + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Queue"); + adapter->add(new QueueI, communicator()->stringToIdentity("queue")); + adapter->activate(); + + shutdownOnInterrupt(); + communicator()->waitForShutdown(); + + return EXIT_SUCCESS; +} |