|
1 /* |
|
2 * Copyright (c) 2008 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 /** |
|
20 @file |
|
21 @internalTechnology |
|
22 */ |
|
23 |
|
24 //User Include |
|
25 #include "shutdowntimer.h" |
|
26 #include "mdnsserver.h" |
|
27 __FLOG_STMT(_LIT8(KComponent,"MDNSServer");) |
|
28 |
|
29 CShutdownTimer* CShutdownTimer::NewL(CMdnsServer& aServer) |
|
30 { |
|
31 |
|
32 CShutdownTimer* self = CShutdownTimer::NewLC(aServer); |
|
33 CleanupStack::Pop(self); |
|
34 |
|
35 return self; |
|
36 } |
|
37 |
|
38 |
|
39 CShutdownTimer* CShutdownTimer::NewLC(CMdnsServer& aServer) |
|
40 { |
|
41 |
|
42 CShutdownTimer* self = new (ELeave) CShutdownTimer(aServer); |
|
43 CleanupStack::PushL(self); |
|
44 self->ConstructL(); |
|
45 |
|
46 return self; |
|
47 } |
|
48 |
|
49 void CShutdownTimer::Start() |
|
50 { |
|
51 TTimeIntervalMicroSeconds32 interval(KShutdownDelay); |
|
52 //After(interval); |
|
53 After(1000000); |
|
54 } |
|
55 |
|
56 |
|
57 void CShutdownTimer::RunL() |
|
58 { |
|
59 // tell the server to begin the shutdown process |
|
60 iServer.BeginShutdownL(); |
|
61 } |
|
62 |
|
63 TInt CShutdownTimer::RunError(TInt /*aError*/) |
|
64 { |
|
65 CActiveScheduler::Stop(); |
|
66 return KErrNone; |
|
67 } |
|
68 |
|
69 CShutdownTimer::CShutdownTimer(CMdnsServer& aServer) |
|
70 : CTimer(EPriorityStandard), iServer(aServer) |
|
71 { |
|
72 CActiveScheduler::Add(this); |
|
73 } |
|
74 |
|
75 CShutdownTimer::~CShutdownTimer() |
|
76 { |
|
77 |
|
78 } |