Class KomodiaDNS::CDNSUDPSocket::
OnSocketReceive()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ~CDNSUDPSocketNext page: operator =    Show member index
Protected Function Declared in:
DNSUDPSocket.h

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

virtual BOOL OnSocketReceive(
    int iErrorCode);

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

Receive the data

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

try
{
    //Check if there's no error
    if (!iErrorCode)
    {
        //Receive the data
        char* pBuffer;
        pBuffer=new char[2000];

        //How much data did we receive
        int iReceived=0;

        //Receive
        iReceived=Receive(pBuffer,2000);

        //If every thing was OK
        if (!iReceived)
        {
            //Dispose of the buffer
            delete [] pBuffer;

            //Inform of an error
            m_pDNSSocket->SocketError(GetSystemLastError());

            //Done
            return TRUE;
        }

        //Inform our father
        m_pDNSSocket->SocketReceive(pBuffer,
                                    iReceived);
    }
    else
        //Inform about the error
        m_pDNSSocket->SocketError(iErrorCode);

    //Always return true
    return TRUE;
}
ERROR_HANDLER_RETURN("OnSocketReceive",TRUE)

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

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