diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-09-09 15:46:16 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-09-09 15:46:16 -0230 |
commit | d25c2d8f8156b33c78b797cd4aa4823d3ade02cc (patch) | |
tree | 65b79d47f8a470ee9d6218687a124444234c0cbf /cpp/demo/Glacier2/chat/Server.cpp | |
parent | Removed bogus file. (diff) | |
download | ice-d25c2d8f8156b33c78b797cd4aa4823d3ade02cc.tar.bz2 ice-d25c2d8f8156b33c78b797cd4aa4823d3ade02cc.tar.xz ice-d25c2d8f8156b33c78b797cd4aa4823d3ade02cc.zip |
- cpp/demo/Ice/session now uses a timer for the periodic reaping.
- cpp/demo/Glacier2/chat now uses a custom permissions verifier,
and a timer for refresh of the Glacier2 session. Squashed commit
of the following:
commit 82732512d64b4b6782b9c96e9c558ad56ea232af
Author: Matthew Newhook <matthew@zeroc.com>
Date: Wed Sep 9 15:35:47 2009 -0230
Simplify session demo.
commit 07cf68b9d12e8d648980d4bcae354e7531411b47
Author: Matthew Newhook <matthew@zeroc.com>
Date: Wed Sep 9 14:59:15 2009 -0230
chat demo now uses a custom perissions verifier, and a timer task.
Diffstat (limited to 'cpp/demo/Glacier2/chat/Server.cpp')
-rw-r--r-- | cpp/demo/Glacier2/chat/Server.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/demo/Glacier2/chat/Server.cpp b/cpp/demo/Glacier2/chat/Server.cpp index feb3c976249..ff6abc6560e 100644 --- a/cpp/demo/Glacier2/chat/Server.cpp +++ b/cpp/demo/Glacier2/chat/Server.cpp @@ -14,6 +14,18 @@ using namespace std; using namespace Demo; +class DummyPermissionsVerifierI : public Glacier2::PermissionsVerifier +{ +public: + + virtual bool + checkPermissions(const string& userId, const string& password, string&, const Ice::Current&) const + { + cout << "verified user `" << userId << "' with password `" << password << "'" << endl; + return true; + } +}; + class ChatSessionManagerI : public Glacier2::SessionManager { public: @@ -40,6 +52,8 @@ public: Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("ChatServer"); + Glacier2::PermissionsVerifierPtr dpv = new DummyPermissionsVerifierI; + adapter->add(dpv, communicator()->stringToIdentity("ChatSessionVerifier")); Glacier2::SessionManagerPtr csm = new ChatSessionManagerI; adapter->add(csm, communicator()->stringToIdentity("ChatSessionManager")); adapter->activate(); |