diff options
author | Jose <jose@zeroc.com> | 2009-07-31 18:47:11 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-07-31 18:47:11 +0200 |
commit | 7a9878305be277b238a1318b2b951ed05c141d4f (patch) | |
tree | 88048d6605dd954425d225e14ca3e3a5dbf312c6 /cpp/demo/Glacier2/chat/ChatSessionI.cpp | |
parent | 4182 - Mutex initialization fails on SLES10 (diff) | |
download | ice-7a9878305be277b238a1318b2b951ed05c141d4f.tar.bz2 ice-7a9878305be277b238a1318b2b951ed05c141d4f.tar.xz ice-7a9878305be277b238a1318b2b951ed05c141d4f.zip |
4181 - demo/Glacier2/chat should use AMI.
Diffstat (limited to 'cpp/demo/Glacier2/chat/ChatSessionI.cpp')
-rw-r--r-- | cpp/demo/Glacier2/chat/ChatSessionI.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/cpp/demo/Glacier2/chat/ChatSessionI.cpp b/cpp/demo/Glacier2/chat/ChatSessionI.cpp index 925a9060932..887f3061589 100644 --- a/cpp/demo/Glacier2/chat/ChatSessionI.cpp +++ b/cpp/demo/Glacier2/chat/ChatSessionI.cpp @@ -61,6 +61,19 @@ Init init; } +class AMI_ChatCallback_messageI : public Demo::AMI_ChatCallback_message +{ +public: + + virtual void ice_response() + { + } + + virtual void ice_exception(const Ice::Exception&) + { + } +}; + ChatRoomPtr& ChatRoom::instance() { @@ -77,7 +90,7 @@ void ChatRoom::enter(const ChatCallbackPrx& callback) { Lock sync(*this); - _members.push_back(ChatCallbackPrx::uncheckedCast(callback->ice_oneway())); + _members.push_back(callback); } void @@ -103,13 +116,7 @@ ChatRoom::message(const string& data) const Lock sync(*this); for(list<ChatCallbackPrx>::const_iterator p = _members.begin(); p != _members.end(); ++p) { - try - { - (*p)->message(data); - } - catch(const Ice::LocalException&) - { - } + (*p)->message_async(new AMI_ChatCallback_messageI(), data); } } |