RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
SessionTimeoutService.hpp
1
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18
19 #ifndef INCLUDE_RCF_SESSIONTIMEOUTSERVICE_HPP
20 #define INCLUDE_RCF_SESSIONTIMEOUTSERVICE_HPP
21
22 #include <set>
23
24 #include <RCF/Export.hpp>
25 #include <RCF/PeriodicTimer.hpp>
26 #include <RCF/Service.hpp>
27 #include <RCF/Timer.hpp>
28
29 namespace RCF {
30
31 class SessionState;
32 typedef boost::shared_ptr<SessionState> SessionStatePtr;
33 typedef boost::weak_ptr<SessionState> SessionStateWeakPtr;
34
35 class RCF_EXPORT SessionTimeoutService : public I_Service
36 {
37 public:
38 SessionTimeoutService();
39
40 private:
41
42 void onServerStart(RcfServer & server);
43 void onServerStop(RcfServer & server);
44
45 void onTimer();
46
47 private:
48
49 std::vector<SessionStateWeakPtr> mSessionsTemp;
50
51 boost::uint32_t mSessionTimeoutMs;
52 boost::uint32_t mReapingIntervalMs;
53 RcfServer * mpRcfServer;
54 PeriodicTimer mPeriodicTimer;
55 };
56
57 typedef boost::shared_ptr<SessionTimeoutService> SessionTimeoutServicePtr;
58
59 } // namespace RCF
60
61 #endif // ! INCLUDE_RCF_SESSIONTIMEOUTSERVICE_HPP