Class CTCPPortScannerLinear::
Scan()
Base ClassesConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ScanNext page: Custom Code in Header Before Includes    Show member index
Public Function Declared in:
TCPPortScannerLinear.h

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

virtual BOOL Scan(
    IP aTarget);

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

//Check max sockets are ok
if (GetMaxSockets()<=0 ||
    !IsDone() ||
    !aTarget)
{
    //Report it
    ReportError("Scan","Invalid parameters!");

    //Exit
    return FALSE;
}

try
{
    //Reset the pair
    ResetPair();

    //Can we scan
    if (!CanScan())
    {
        //Error
        ReportError("Scan","No ports given!");

        //Error
        SetError(TRUE);

        //Exit
        return FALSE;
    }

    //Set the flags
    SetError(FALSE);
    SetDone(FALSE);

    //Save the number of max sockets
    ResetSocketCount();

    //Delete the port data
    DeletePortsMap();

    //Delete other data
    ResetData();

    //Set our target
    SetTarget(aTarget);

    //Start the loop
    for (int iCounter=0;
         iCounter<GetMaxSockets();
         ++iCounter)
    {
        BOOL bQuit;
        bQuit=FALSE;

        //Try to allocate sockets
        while (!bQuit)
        {
            //Another socket
            AdjustNumberOfSockets(1);

            //Create it
            if (!(bQuit=NewSocket()))
                ReportError("Scan","Failed to create socket!");
        }
    }

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

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

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