diff options
Diffstat (limited to 'cpp/demo/Ice/bidir/Client.cpp')
-rw-r--r-- | cpp/demo/Ice/bidir/Client.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/cpp/demo/Ice/bidir/Client.cpp b/cpp/demo/Ice/bidir/Client.cpp deleted file mode 100644 index 080ba7b7a32..00000000000 --- a/cpp/demo/Ice/bidir/Client.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 <IceUtil/IceUtil.h> -#include <Ice/Ice.h> -#include <Callback.h> - -using namespace std; -using namespace Demo; - -class CallbackReceiverI : public CallbackReceiver -{ -public: - - virtual void - callback(Ice::Int num, const Ice::Current&) - { - cout << "received callback #" << num << endl; - } -}; - -class CallbackClient : public Ice::Application -{ -public: - - virtual int run(int, char*[]); -}; - -int -main(int argc, char* argv[]) -{ - CallbackClient app; - return app.main(argc, argv, "config.client"); -} - -int -CallbackClient::run(int argc, char*[]) -{ - if(argc > 1) - { - cerr << appName() << ": too many arguments" << endl; - return EXIT_FAILURE; - } - - CallbackSenderPrx server = CallbackSenderPrx::checkedCast(communicator()->propertyToProxy("CallbackSender.Proxy")); - if(!server) - { - cerr << appName() << ": invalid proxy" << endl; - return EXIT_FAILURE; - } - - Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter(""); - Ice::Identity ident; - ident.name = IceUtil::generateUUID(); - ident.category = ""; - CallbackReceiverPtr cr = new CallbackReceiverI; - adapter->add(cr, ident); - adapter->activate(); - server->ice_getConnection()->setAdapter(adapter); - server->addClient(ident); - communicator()->waitForShutdown(); - - return EXIT_SUCCESS; -} |