Class CWhoisSocket::
OnSocketReceive()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: OnSocketConnectNext page: OnSocketTimeout    Show member index
Protected Function Declared in:
WhoisSocket.h

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

virtual BOOL OnSocketReceive(
    int iErrorCode);

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

try
{
    //Kill the timer
    KillTimer();

    //Do we have an error
    if (iErrorCode)
    {
        //Report it
        ReportError("OnSocketReceive",iErrorCode);

        //We are done
        QueryDone(TRUE,
                  TRUE);

        //Exit
        return FALSE;
    }

    //Receive the data
    char aData[4000];

    //Get the data
    int iSize;
    iSize=Receive(aData,sizeof(aData)/2-1);

    //Is an error
    if (iSize==GetErrorCode())
    {
        //We are done
        QueryDone(TRUE,
                  TRUE);

        //Exit
        return FALSE;
    }

    //Remove nulls
    for (int iCounter=0;
         iCounter<iSize;
         iCounter++)
        if (!aData[iCounter])
            aData[iCounter]=10;

    //Set the terminating sero
    aData[iSize]=0;

    //Modify it
    ModifyBuffer(aData,iSize+1);

    //Add it to the string
    m_sWhoisData+=aData;

    //Reset the timeout
    SetTimeout(m_dwTimeout);

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

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

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