Class CRealTimeTraceRouteSocket::
ResolveData()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: PingDoneDataNext page: SetResolveStatus    Show member index
Private Function Declared in:
RealTimeTraceRouteSocket.h

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

static void ResolveData(
    LPVOID lpData);

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

Our thread for DNS queries

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

try
{
    //Get the data
    std::auto_ptr<ResolveThreadData> pData((ResolveThreadData*)lpData);

    //Our ID
    unsigned short usID;

    //Adjust flag
    BOOL bAdjust;

    //Copy the data
    TraceRouteData aData;

    {
        //Lock the data
        CCriticalAutoRelease aRelease(pData->pData->pCSection.get(),TRUE);

        //Copy it
        aData=*pData->pData;
    }

    //Check the hops
    if (aData.ucTTL>=mhMaxHops)
    {
        //Adjust the resolvers
        pData->pClass->AdjustResolvers(-1);

        //Dns is done
        pData->pClass->DNSDone();

        //Exit
        return;
    }
    else if (!aData.ucTTL)
        usID=rand()%60000+mhMaxHops;
    else
        usID=aData.ucTTL;

    //Do we need to adjust
    bAdjust=TRUE;

    //Resolve it
    //Do we have the dns
    if (aData.pDNS)
        if (aData.pDNS->GetDNSEntry(aData.aReplyingAddress,
                                    usID,
                                    (LPVOID)pData->pData))
            bAdjust=FALSE;
    else
        ReportStaticError(CRealTimeTraceRouteSocket_Class,"ResolveData","Missing DNS information!");

    //Adjust the resolvers
    if (bAdjust)
    {
        //Adjust it
        pData->pClass->AdjustResolvers(-1);

        //Dns is done
        pData->pClass->DNSDone();
    }
}
ERROR_HANDLER_STATIC(CRealTimeTraceRouteSocket_Class,"ResolveData")

'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.