Class CTCPPortScanner::
SocketDone()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SetTargetNext page: SocketDone    Show member index
Protected Function Declared in:
TCPPortScanner.h

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

void SocketDone(
    unsigned short usPort,
    BOOL bConnected);

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

When socket is done

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

try
{
    if (m_bDone ||
        m_bFinished)
        return;

    //Only if connected
    if (bConnected)
    {
        //Lock the data
        CCriticalAutoRelease aRelease(m_pCSection,TRUE);

        //Did we receive this answer already?
        if (m_aPortAnswers.find(usPort)!=m_aPortAnswers.end())
            return;

        //Add it to the list
        m_aPortList.insert(usPort);

        //And to the existing ports
        m_aPortAnswers.insert(usPort);
    }

    //Inicate for user
    OnPort(usPort,
           bConnected);

    long lCount;
    lCount=AdjustNumberOfSockets(-1);

    //Decrease our count
    if (!CanScan() &&
        lCount<=0)
        ScanDone(FALSE);
    else
    {
        //Quit flag
        BOOL bQuit;
        bQuit=FALSE;

        //Create the socket
        while (!bQuit)
        {
            //Adjust the number of sockets
            AdjustNumberOfSockets(1);

            //Allocate it
            if (!(bQuit=NewSocket()))
                ReportError("SocketDone","Error creating the socket!");
        }
    }
}
ERROR_HANDLER("SocketDone")

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