|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cnatbindingcrlfrefresher.h" |
|
20 #include "ccrlfsender.h" |
|
21 |
|
22 const TInt KMicroSecondsInSecond = 1000000; |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CNATBindingCRLFRefresher::CNATBindingCRLFRefresher |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 CNATBindingCRLFRefresher::CNATBindingCRLFRefresher( |
|
29 CDeltaTimer& aDeltaTimer, |
|
30 TInt aRefreshInterval, |
|
31 MNATBindingRefresherObserver& aObserver, |
|
32 CCRLFSender* aSender) |
|
33 : CNATBindingRefresher(aDeltaTimer,aObserver), |
|
34 iRefreshInterval(aRefreshInterval), |
|
35 iSender(aSender) |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CNATBindingCRLFRefresher::~CNATBindingCRLFRefresher |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CNATBindingCRLFRefresher::~CNATBindingCRLFRefresher() |
|
44 { |
|
45 delete iSender; |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CNATBindingCRLFRefresher::PersistentConnectionRequired |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 TBool CNATBindingCRLFRefresher::PersistentConnectionRequired() const |
|
53 { |
|
54 return iSender->PersistentConnectionRequired(); |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CNATBindingCRLFRefresher::HasSocket |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 TBool CNATBindingCRLFRefresher::HasSocket(const RSocket& aSocket) const |
|
62 { |
|
63 return iSender->HasSocket(aSocket); |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CNATBindingCRLFRefresher::HasSocket |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 TBool CNATBindingCRLFRefresher::HasSocket(const CSecureSocket& aSocket) const |
|
71 { |
|
72 return iSender->HasSocket(aSocket); |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CNATBindingCRLFRefresher::RefreshInterval |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 TInt CNATBindingCRLFRefresher::RefreshInterval() |
|
80 { |
|
81 return (iRefreshInterval*KMicroSecondsInSecond); |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CNATBindingCRLFRefresher::RefreshTimerExpiredL |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void CNATBindingCRLFRefresher::RefreshTimerExpiredL() |
|
89 { |
|
90 iSender->Cancel(); |
|
91 iSender->Send(); |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CNATBindingCRLFRefresher::CancelRefresh |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 void CNATBindingCRLFRefresher::CancelRefresh() |
|
99 { |
|
100 iSender->Cancel(); |
|
101 } |