supl/locationsuplfw/protocolhandlerapi/src/epos_csuplsockettimer.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 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:   Class to handle socket timeout 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32base.h>
       
    22 #include "epos_csuplsockettimer.h"
       
    23 #include "epos_csuplconnection.h"
       
    24 
       
    25 #include "epos_csuplconntrace.h"
       
    26 _LIT(KTraceFileName, "SUPL_PH_API::epos_csuplsockettimer.cpp");
       
    27 
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 //
       
    36 CSuplSocketTimer::CSuplSocketTimer(CSuplConnection* aConnection)
       
    37     : CTimer(EPriorityLow),
       
    38     iConnection(aConnection)
       
    39     {
       
    40     CActiveScheduler::Add(this);
       
    41     }
       
    42 
       
    43 // Destructor
       
    44 CSuplSocketTimer::~CSuplSocketTimer()
       
    45     {
       
    46     Cancel();
       
    47     delete iTrace;
       
    48     }
       
    49 
       
    50 // Two-phased constructor
       
    51 CSuplSocketTimer* CSuplSocketTimer::NewL(CSuplConnection* aConnection)
       
    52     {
       
    53     CSuplSocketTimer* self = new (ELeave) CSuplSocketTimer(aConnection);
       
    54     CleanupStack::PushL(self);
       
    55     self->ConstructL();
       
    56     CleanupStack::Pop();
       
    57     return self;
       
    58     }
       
    59 
       
    60 // EPOC default constructor
       
    61 void CSuplSocketTimer::ConstructL()
       
    62     {
       
    63     iTrace = CSuplConnTrace::NewL();            
       
    64     iTrace->Trace(_L("CSuplSocketTimer::ConstructL"), KTraceFileName, __LINE__);
       
    65     CTimer::ConstructL();
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // CSuplSocketTimer::Start
       
    70 //
       
    71 // (other items were commented in a header).
       
    72 // ---------------------------------------------------------
       
    73 //
       
    74 void CSuplSocketTimer::Start(TTimeIntervalMicroSeconds32 aDelay)
       
    75     {
       
    76     iTrace->Trace(_L("CSuplSocketTimer::Start"), KTraceFileName, __LINE__);
       
    77     After(aDelay);
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CSuplSocketTimer::RunL
       
    82 //
       
    83 // (other items were commented in a header).
       
    84 // ---------------------------------------------------------
       
    85 //
       
    86 void CSuplSocketTimer::RunL()
       
    87     {
       
    88     iTrace->Trace(_L("CSuplSocketTimer::RunL"), KTraceFileName, __LINE__);
       
    89     //iConnection->Cancel();
       
    90     iConnection->TimerExpired();
       
    91     }
       
    92 
       
    93 // End of File