Class CTCPPortScanner::
CTCPScanner::OnSocketReceive()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: CTCPScanner::OnSocketConnectNext page: CTCPScanner::OnSocketTimeout    Show member index
Private Function
(Not Declared)
Declared in:
TCPPortScanner.h

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

BOOL CTCPScanner::OnSocketReceive(
    int iErrorCode);

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

try
{
    //Can we receive
    if (!m_iDataSize)
        return TRUE;

    //Kill the timer
    KillTimer();

    //Allocate the buffer
    char* pData;
    pData=new char[m_iDataSize];

    //Receive the data
    int iSize;
    iSize=Receive(pData,m_iDataSize-1);

    //Do we have an error ?
    if (iSize==GetErrorCode())
    {
        //Notify father
        m_pFather->SocketDone(m_usPort,
                              TRUE);

        //Delete the buffer
        delete [] pData;
    }
    else
    {
        //Set terminating null
        pData[iSize]=0;

        //Notify father
        m_pFather->SocketDone(m_usPort,
                              pData,
                              iSize);
    }

    //Delete ourselves
    DeleteSocketFromThread(7000);

    //Exit
    return TRUE;
}
ERROR_HANDLER_RETURN("OnSocketReceive",TRUE)

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