diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-08-19 12:38:41 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-08-19 12:38:41 -0700 |
commit | 6d692f31dd7c66b9900341f9d7ede86b11b63486 (patch) | |
tree | 6c83b006fcf54207762d7bd6f0d583522f600dda /cpp/demo/cookbook/compression/Server.cpp | |
parent | fixing NPE in Java class-loading code (diff) | |
download | ice-6d692f31dd7c66b9900341f9d7ede86b11b63486.tar.bz2 ice-6d692f31dd7c66b9900341f9d7ede86b11b63486.tar.xz ice-6d692f31dd7c66b9900341f9d7ede86b11b63486.zip |
adding compression cookbook demo
Diffstat (limited to 'cpp/demo/cookbook/compression/Server.cpp')
-rw-r--r-- | cpp/demo/cookbook/compression/Server.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cpp/demo/cookbook/compression/Server.cpp b/cpp/demo/cookbook/compression/Server.cpp new file mode 100644 index 00000000000..8c994dee21d --- /dev/null +++ b/cpp/demo/cookbook/compression/Server.cpp @@ -0,0 +1,48 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 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 <Compression.h> + +using namespace std; +using namespace Compression; + +class ReceiverI : public Receiver +{ +public: + + virtual void sendData(const ByteSeq&, const Ice::Current&) + { + } +}; + +class Server : public Ice::Application +{ +public: + + virtual int run(int, char*[]); +}; + +int +main(int argc, char* argv[]) +{ + Server app; + return app.main(argc, argv, "config.server"); +} + +int +Server::run(int argc, char* argv[]) +{ + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Compression"); + Ice::ObjectPtr object = new ReceiverI; + adapter->add(object, communicator()->stringToIdentity("receiver")); + adapter->activate(); + communicator()->waitForShutdown(); + return EXIT_SUCCESS; +} |