Class CAsyncSocket::
SetHandlers()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SetAsyncNext page: SetInstance    Show member index
Private Function Declared in:
AsyncSocket.h

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

static BOOL SetHandlers();

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

Create our handlers

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

try
{
    //First create the window class
    if (!m_bWindow)
        if (!RegisterWindow())
        {
            //Report it
            ReportStaticError(CAsyncSocket_Class,"SetHandlers","Error registering the window, please check API error!");

            //Exit
            return FALSE;
        }
        else
            //Window is OK
            m_bWindow=TRUE;

    //Do we have a manager ?
    if (!m_pThreadManager)
    {
        //How many threads we want
        int iThreads;
        if (CSpoofBase::IsMultiThreaded())
            iThreads=CSpoofBase::GetNumberOfThreads();
        else
            iThreads=1;

        //Initialize as multithreaded
        m_pThreadManager=new CSocketThreadManager(m_hInstance);
        if (!m_pThreadManager->Initialize(iThreads,
                                          CAsyncSocket_Class))
        {
            //Report it
            ReportStaticError(CAsyncSocket_Class,"SetHandlers","Failed to initialize the thread manager!");

            //Delete it
            delete m_pThreadManager;
            m_pThreadManager=NULL;

            //Exit
            return FALSE;
        }
    }

    //Created !!
    //Success
    return TRUE;
}
ERROR_HANDLER_STATIC_RETURN(CAsyncSocket_Class,"CAsyncSocket",FALSE)

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

Class Overview Class Overview  |  Protected base class CSpoofBase  |  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.