datacommsserver/esockserver/ssock/SS_TIMER.CPP
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1997-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 /**
       
    17  @file
       
    18  @internalTechnology 
       
    19 */
       
    20 
       
    21 #include <ss_pman.h>
       
    22 
       
    23 EXPORT_C void SocketTimer::Queue(TTimeIntervalMicroSeconds32 aTimeInMicroSeconds,TDeltaTimerEntry& aTimer)
       
    24 /**
       
    25 Queue a timer on the global timer
       
    26 
       
    27 */
       
    28 	{
       
    29 	_LIT(sockTimer,"SockTimer");
       
    30 	__ASSERT_ALWAYS(aTimeInMicroSeconds.Int()>0,User::Panic(sockTimer,0));
       
    31 
       
    32 #ifdef __MARM__
       
    33 	if(aTimeInMicroSeconds.Int()<100000)
       
    34 		aTimeInMicroSeconds=aTimeInMicroSeconds.Int()+KTimerGranularity+(KTimerGranularity>>2);
       
    35 #endif
       
    36 	SocketServer::GetTimer()->Queue(aTimeInMicroSeconds,aTimer);
       
    37 	}
       
    38 
       
    39 EXPORT_C void SocketTimer::Remove(TDeltaTimerEntry& aTimer)
       
    40 /**
       
    41 Call cancel on the global timer
       
    42 
       
    43 */
       
    44 	{
       
    45 	SocketServer::GetTimer()->Remove(aTimer);
       
    46 	}