nettools/conntest/Engine/SendTimer.cpp
changeset 0 857a3e953887
equal deleted inserted replaced
-1:000000000000 0:857a3e953887
       
     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: CSendTimer is used for sending data at specified intervals
       
    15 *
       
    16 */
       
    17 
       
    18 #include "SendTimer.h"
       
    19 #include "SocketsEngine.h"
       
    20 
       
    21 // ---------------------------------------------------------
       
    22 // CSendTimer::NewL(const TInt aPriority, CSocketsEngine* aEngine)
       
    23 // EPOC two phased constructor
       
    24 // ---------------------------------------------------------
       
    25 //
       
    26 CSendTimer* CSendTimer::NewL(const TInt aPriority, CSocketsEngine* aEngine)
       
    27 {
       
    28     CSendTimer* self = CSendTimer::NewLC(aPriority, aEngine);
       
    29     CleanupStack::Pop(self);
       
    30     return self;
       
    31 }
       
    32 
       
    33 
       
    34 // ---------------------------------------------------------
       
    35 // CSendTimer::NewLC(const TInt aPriority, CConnTestView* aView)
       
    36 // EPOC two phased constructor
       
    37 // ---------------------------------------------------------
       
    38 //
       
    39 CSendTimer* CSendTimer::NewLC(const TInt aPriority, CSocketsEngine* aEngine)
       
    40 {
       
    41     CSendTimer* self = new (ELeave) CSendTimer(aPriority, aEngine);
       
    42     CleanupStack::PushL(self);
       
    43     self->ConstructL();
       
    44     return self;
       
    45 }
       
    46 
       
    47 
       
    48 // ---------------------------------------------------------
       
    49 // CSendTimer::CSendTimer(const TInt aPriority, CConnTestView* aView)
       
    50 // Constructor
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 CSendTimer::CSendTimer(const TInt aPriority, CSocketsEngine* aEngine)
       
    54 : CTimer(aPriority), iEngine(aEngine)
       
    55 {
       
    56 }
       
    57 
       
    58 
       
    59 // ---------------------------------------------------------
       
    60 // CSendTimer::~CSendTimer()
       
    61 // Destructor
       
    62 // ---------------------------------------------------------
       
    63 //
       
    64 CSendTimer::~CSendTimer()
       
    65 {
       
    66     Cancel();
       
    67 }
       
    68 
       
    69 
       
    70 // ---------------------------------------------------------
       
    71 // CSendTimer::ConstructL()
       
    72 // EPOC two-phased constructor
       
    73 // ---------------------------------------------------------
       
    74 //
       
    75 void CSendTimer::ConstructL()
       
    76 {
       
    77     CTimer::ConstructL();
       
    78     CActiveScheduler::Add(this);
       
    79 }
       
    80 
       
    81 // ---------------------------------------------------------
       
    82 // CSendTimer::RunL()
       
    83 // Timer event has been generated and timer request completed.
       
    84 // ---------------------------------------------------------
       
    85 //
       
    86 void CSendTimer::RunL()
       
    87 {
       
    88     // Timer request has completed, so notify the timer's owner
       
    89     iEngine->DoSendDataL();    
       
    90 }
       
    91