diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-01-17 18:11:11 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-01-17 18:11:11 +0000 |
commit | e124e693704faa56ecf32ce2a243d0c3fa3a5e6e (patch) | |
tree | 071dcaa6edc458f9371289976a4537880e5bb005 /cpp/demo/Ice/async/HelloI.cpp | |
parent | Changed async demo (diff) | |
download | ice-e124e693704faa56ecf32ce2a243d0c3fa3a5e6e.tar.bz2 ice-e124e693704faa56ecf32ce2a243d0c3fa3a5e6e.tar.xz ice-e124e693704faa56ecf32ce2a243d0c3fa3a5e6e.zip |
Changed demo
Diffstat (limited to 'cpp/demo/Ice/async/HelloI.cpp')
-rw-r--r-- | cpp/demo/Ice/async/HelloI.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cpp/demo/Ice/async/HelloI.cpp b/cpp/demo/Ice/async/HelloI.cpp new file mode 100644 index 00000000000..4f2779faab6 --- /dev/null +++ b/cpp/demo/Ice/async/HelloI.cpp @@ -0,0 +1,43 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2007 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 <HelloI.h> +#include <Ice/Ice.h> + +using namespace std; + +HelloI::HelloI(const WorkQueuePtr& workQueue) : + _workQueue(workQueue) +{ +} + +void +HelloI::sayHello_async(const Demo::AMD_Hello_sayHelloPtr& cb, int delay, const Ice::Current&) +{ + if(delay == 0) + { + cout << "Hello World!" << endl; + cb->ice_response(); + } + else + { + _workQueue->add(cb, delay); + } +} + +void +HelloI::shutdown(const Ice::Current& curr) +{ + cout << "Shutting down..." << endl; + + _workQueue->destroy(); + _workQueue->getThreadControl().join(); + + curr.adapter->getCommunicator()->shutdown(); +} |