|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CIMSOCKETIDLETIMER_H__ |
|
17 #define __CIMSOCKETIDLETIMER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 class CImTextServerSession; |
|
22 |
|
23 |
|
24 /** |
|
25 This class provides a timer for inactivity on the socket when either sending or receiving data |
|
26 When the timer expires, iObserver object is informed and the socket is closed |
|
27 */ |
|
28 |
|
29 class CImSocketIdleTimer : public CTimer |
|
30 /** |
|
31 @internalComponent |
|
32 */ |
|
33 |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 //cat Construction |
|
39 Intended Usage : Static factory constructor. Uses two phase construction and |
|
40 leaves nothing on the CleanupStack. |
|
41 @since 7.0s |
|
42 @return A pointer to the newly created CImSocketIdleTimer object. |
|
43 @pre None |
|
44 @post A fully constructed and initialised CImSocketIdleTimer object. |
|
45 |
|
46 */ |
|
47 static CImSocketIdleTimer* NewL(CImTextServerSession& aObserver); |
|
48 |
|
49 /** |
|
50 //cat Destruction |
|
51 @fn ~CImSocketIdleTimer() |
|
52 Intended Usage : Destructor. |
|
53 @since 7.0s |
|
54 */ |
|
55 virtual ~CImSocketIdleTimer(); |
|
56 |
|
57 private: // methods from CActive |
|
58 virtual void RunL(); |
|
59 |
|
60 private: |
|
61 |
|
62 /** |
|
63 //cat Construction |
|
64 @fn CImSocketIdleTimer(CImTextServerSession& aObserver); |
|
65 Intended Usage : Constructor. First phase of two-phase construction method. Does |
|
66 non-allocating construction. |
|
67 @since 7.0s |
|
68 @param aObserver is the CImTextServerSession object that needs to be alerted when |
|
69 the timer expires |
|
70 */ |
|
71 CImSocketIdleTimer(CImTextServerSession& aObserver); |
|
72 |
|
73 private: |
|
74 //the object that reads/writes to the socket |
|
75 CImTextServerSession& iObserver; |
|
76 }; |
|
77 |
|
78 #endif // __CIMSOCKETIDLETIMER_H__ |