diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-11-30 11:00:17 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-11-30 11:00:17 -0330 |
commit | 60276ae3101dfc1fa1bb7b7ee2d23cb474e9666d (patch) | |
tree | 29b7541fed602821c8d5ea7ec418eba18c423a24 /cpp/demo/Ice/async/Client.cpp | |
parent | 4387 - Commited IceGrid/Scanner.cpp doesn't compilce with VC9 (diff) | |
download | ice-60276ae3101dfc1fa1bb7b7ee2d23cb474e9666d.tar.bz2 ice-60276ae3101dfc1fa1bb7b7ee2d23cb474e9666d.tar.xz ice-60276ae3101dfc1fa1bb7b7ee2d23cb474e9666d.zip |
Changed demos to use new AMI API
Diffstat (limited to 'cpp/demo/Ice/async/Client.cpp')
-rw-r--r-- | cpp/demo/Ice/async/Client.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/demo/Ice/async/Client.cpp b/cpp/demo/Ice/async/Client.cpp index 70e7f781abf..58a9bda938b 100644 --- a/cpp/demo/Ice/async/Client.cpp +++ b/cpp/demo/Ice/async/Client.cpp @@ -13,19 +13,20 @@ using namespace std; using namespace Demo; -class AMI_Hello_sayHelloI : public AMI_Hello_sayHello +class Callback : public IceUtil::Shared { public: - virtual void ice_response() + void response() { } - virtual void ice_exception(const Ice::Exception& ex) + void exception(const Ice::Exception& ex) { cerr << "sayHello AMI call failed:\n" << ex << endl; } }; +typedef IceUtil::Handle<Callback> CallbackPtr; class AsyncClient : public Ice::Application { @@ -37,6 +38,7 @@ public: private: + void exception(const Ice::Exception&); void menu(); }; @@ -74,6 +76,8 @@ AsyncClient::run(int argc, char* argv[]) menu(); + CallbackPtr cb = new Callback(); + char c; do { @@ -87,7 +91,7 @@ AsyncClient::run(int argc, char* argv[]) } else if(c == 'd') { - hello->sayHello_async(new AMI_Hello_sayHelloI, 5000); + hello->begin_sayHello(5000, newCallback_Hello_sayHello(cb, &Callback::response, &Callback::exception)); } else if(c == 's') { @@ -128,3 +132,4 @@ AsyncClient::menu() "x: exit\n" "?: help\n"; } + |