Class CTraceRouteSocket::
PingDone()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: PingNext page: TakeData    Show member index
Protected Function Declared in:
TraceRouteSocket.h

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

virtual void PingDone(
    BOOL bTimeout);

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

Events for user to overide

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

try
{
    //The data record
    TraceRouteData aData;
    aData.ucTTL=m_ucTTL;
    aData.bTimeout=bTimeout;
    aData.dwElapsedTime=GetTimeElapsed();

    //Is it a timeout ?
    if (bTimeout)
        //Can we ping again
        if (m_ucTTL>m_ucMaxTTL)
            m_bTraceDone=TRUE;
        else
            ;
    else
    {
        //Save the data
        aData.aReplyingAddress=GetReplyingAddress();

        //Are we done
        if (aData.aReplyingAddress==m_aFinalAddress)
            m_bTraceDone=TRUE;
    }

    //Add the data
    m_aData.push_back(aData);

    //Call user with the data
    TraceData(aData);

    //Check if we are done ?
    if (m_bTraceDone ||
        (bTimeout &&
         m_ucTTL>m_ucMaxTTL))
        //Dispatch the event
        TraceDone();
    else
    {
        //Increase our ttl
        ++m_ucTTL;

        //Send the next ping
        if (!Ping(m_aFinalAddress,
                  m_dwTimeout))
        {
            //There's an error report and continue
            ReportError("PingDone","Failed to ping!");

            //Make it a timeout
            PingDone(TRUE);
        }
    }
}
ERROR_HANDLER("PingDone")

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

Class Overview Class Overview  |  Public base class CPingSocket  |  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.