email/pop3andsmtpmtm/servermtmutils/src/cimsocketidletimer.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "cimsocketidletimer.h"
       
    17 
       
    18 #include "IMSK.H"
       
    19 
       
    20 
       
    21 //
       
    22 // Factory function for creating and returning a CImSocketIdleTimer instance
       
    23 //
       
    24 CImSocketIdleTimer* CImSocketIdleTimer::NewL(CImTextServerSession& aObserver)
       
    25 	{
       
    26 	CImSocketIdleTimer* self = new (ELeave) CImSocketIdleTimer(aObserver);
       
    27 	CleanupStack::PushL(self);
       
    28 	self->ConstructL();
       
    29 	CleanupStack::Pop(self);
       
    30 	return self;
       
    31 	}
       
    32 
       
    33 //
       
    34 // Construction
       
    35 //
       
    36 CImSocketIdleTimer::CImSocketIdleTimer(CImTextServerSession& aObserver)
       
    37 : CTimer(CActive::EPriorityStandard), iObserver(aObserver)
       
    38 	{
       
    39 	CActiveScheduler::Add(this);
       
    40 	}
       
    41 
       
    42 //
       
    43 // Destruction
       
    44 //
       
    45 CImSocketIdleTimer::~CImSocketIdleTimer()
       
    46 	{
       
    47 	Cancel();
       
    48 	}
       
    49 
       
    50 // methods from CActive
       
    51 
       
    52 void CImSocketIdleTimer::RunL()
       
    53 	{
       
    54 	// Need to tell the text server session that the timer has expired - stop the
       
    55 	// current send/receive activity.
       
    56 	iObserver.SocketIdle();
       
    57 	}