summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/ReapTask.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2009-09-09 15:46:16 -0230
committerMatthew Newhook <matthew@zeroc.com>2009-09-09 15:46:16 -0230
commitd25c2d8f8156b33c78b797cd4aa4823d3ade02cc (patch)
tree65b79d47f8a470ee9d6218687a124444234c0cbf /cpp/demo/Ice/session/ReapTask.h
parentRemoved bogus file. (diff)
downloadice-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/Ice/session/ReapTask.h')
-rw-r--r--cpp/demo/Ice/session/ReapTask.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/cpp/demo/Ice/session/ReapTask.h b/cpp/demo/Ice/session/ReapTask.h
new file mode 100644
index 00000000000..99c135c5366
--- /dev/null
+++ b/cpp/demo/Ice/session/ReapTask.h
@@ -0,0 +1,41 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 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.
+//
+// **********************************************************************
+
+#ifndef REAP_TASK_H
+#define REAP_TASK_H
+
+#include <IceUtil/IceUtil.h>
+#include <SessionI.h>
+#include <list>
+
+class ReapTask : public IceUtil::TimerTask, public IceUtil::Monitor<IceUtil::Mutex>
+{
+public:
+
+ ReapTask();
+
+ virtual void runTimerTask();
+ void terminate();
+ void add(const Demo::SessionPrx&, const SessionIPtr&);
+
+private:
+
+ const IceUtil::Time _timeout;
+ struct SessionProxyPair
+ {
+ SessionProxyPair(const Demo::SessionPrx& p, const SessionIPtr& s) :
+ proxy(p), session(s) { }
+ const Demo::SessionPrx proxy;
+ const SessionIPtr session;
+ };
+ std::list<SessionProxyPair> _sessions;
+};
+typedef IceUtil::Handle<ReapTask> ReapTaskPtr;
+
+#endif