vpnengine/ikev1lib/src/ikev1timeout.cpp
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:   Source for timer class used by IKEv1
       
    15 *
       
    16 */
       
    17 
       
    18 #include "ikev1timeout.h"
       
    19 #include "ikev1negotiation.h"
       
    20 
       
    21 
       
    22 CIkev1Timeout* CIkev1Timeout::NewL(CIkev1Negotiation& aNegotiation)
       
    23     {
       
    24     CIkev1Timeout* self = new (ELeave) CIkev1Timeout(aNegotiation);
       
    25     CleanupStack::PushL(self);
       
    26     self->ConstructL();
       
    27     CleanupStack::Pop(self);
       
    28     
       
    29     return self;
       
    30     }
       
    31 
       
    32 
       
    33 CIkev1Timeout::CIkev1Timeout(CIkev1Negotiation& aNegotiation)
       
    34  : CTimer(EPriorityStandard),
       
    35    iNegotiation(aNegotiation)
       
    36     {
       
    37     CActiveScheduler::Add(this);    //Adds itself to the scheduler only the first time
       
    38     }
       
    39 
       
    40 
       
    41 CIkev1Timeout::~CIkev1Timeout()
       
    42     {
       
    43     if (IsActive())
       
    44         Cancel();
       
    45     }
       
    46 
       
    47 
       
    48 //Issues next RunL execution
       
    49 void CIkev1Timeout::IssueRequest(TTimeIntervalMicroSeconds32 anInterval)
       
    50     {
       
    51     After(anInterval);  //Also sets the object as Active
       
    52     }
       
    53 
       
    54 
       
    55 // CPacketTimeout
       
    56 // will send all the packets. One packet each Time
       
    57 void CIkev1Timeout::RunL()
       
    58     {
       
    59     iNegotiation.ReSendL();
       
    60     }
       
    61 
       
    62 
       
    63 
       
    64