|
1 /** @file |
|
2 * Copyright (c) 2005-2006 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 #include "upnpcpbinitialeventretry.h" |
|
19 #include "upnpcpbinitialeventretryhandler.h" |
|
20 #include "upnpcontrolpoint.h" |
|
21 |
|
22 static const TInt KCpInitialEventTimeout = 1000000; |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CUpnpCpbInitialEventRetryHandler::CUpnpCpbInitialEventRetryHandler |
|
26 // |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 CUpnpCpbInitialEventRetryHandler::CUpnpCpbInitialEventRetryHandler( CUpnpControlPoint& aCp ): |
|
30 iControlPoint( aCp ) |
|
31 { |
|
32 // No implementation required |
|
33 } |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CUpnpCpbInitialEventRetryHandler::CUpnpCpbInitialEventRetryHandler |
|
37 // |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 CUpnpCpbInitialEventRetryHandler::~CUpnpCpbInitialEventRetryHandler() |
|
41 { |
|
42 iList.ResetAndDestroy(); |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CUpnpCpbInitialEventRetryHandler::AddL |
|
47 // Ownership of the argument is passed through |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 void CUpnpCpbInitialEventRetryHandler::AddL( CUpnpGenaMessage* aMsg ) |
|
51 { |
|
52 //ownership is passed through |
|
53 CUpnpCpbInitialEventRetry* timer = CUpnpCpbInitialEventRetry::NewLC( aMsg, *this ); |
|
54 iList.AppendL( timer ); |
|
55 CleanupStack::Pop( timer ); |
|
56 timer->After( KCpInitialEventTimeout ); |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CUpnpCpbInitialEventRetryHandler::TimerExpired |
|
61 // |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 void CUpnpCpbInitialEventRetryHandler::TimerExpired( CUpnpCpbInitialEventRetry* aTimer ) |
|
65 { |
|
66 TInt index = iList.Find( aTimer ); |
|
67 ASSERT( index != KErrNotFound ); |
|
68 iList.Remove( index ); |
|
69 TRAP_IGNORE( iControlPoint.HandlePostponedInitialEventL( aTimer->Message() ) ) ; |
|
70 delete aTimer; |
|
71 } |
|
72 |
|
73 |
|
74 |
|
75 |