Class CSocketThreadManager::
RemoveTimeout()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: RegisterTimeoutNext page: ReSetTimeout    Show member index
Public Function Declared in:
SocketThreadManager.h

'Declaration' icon -- Shortcut to top of page. Declaration

BOOL RemoveTimeout(
    TimerID& aTimerID);

'Description' icon -- Shortcut to top of page. Description

Remove a timer

'Function Body' icon -- Shortcut to top of page. Function Body

//Check it's a valid timeout
if (!aTimerID.iIndex)
{
    //Write the error
    ReportError("RemoveTimeout","Received invalid TimerID");

    //Quit
    return FALSE;
}

try
{
    //Our timer ID
    TimerID aID;
    aID=aTimerID;

    {
        //Lock the timeout manager
        CCriticalAutoRelease aRelease(m_pThreadData[aID.iIndex-1].pCSection);

        //Check the ID now
        if (!aTimerID.iIndex)
            return TRUE;

        //No remove from the map
        m_pThreadData[aTimerID.iIndex-1].pMap.erase(aTimerID.iTimerID);

        //Decrease the count
        --m_pThreadData[aTimerID.iIndex-1].iTimeoutCount;

        //Set the old timer ID
        aTimerID.iIndex=0;
        aTimerID.iMS=0;
        aTimerID.iTimerID=0;
    }

    //First unregister the timer
    if (!KillTimer(m_pThreadData[aID.iIndex-1].hWindowHandle,
                   aID.iTimerID))
        //Report it
        ReportErrorOS("RemoveTimeout","Failed to delete timer!");

    //Done
    return TRUE;
}
ERROR_HANDLER_RETURN("RemoveTimeout",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CErrorHandler  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.