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

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

virtual CTCPSocketAsync * AllocateSocket(
    unsigned short usPort) const;

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

Actual a new socket Derived class should override this for their sockets

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

try
{
    CTCPScanner* pSocket;
    pSocket=new CTCPScanner((CTCPPortScanner*)this,
                            usPort,
                            GetReceiveDataSize(),
                            GetReceiveDataTimeout());

    //Do we have receive data ?
    if (!GetReceiveDataSize())
        //Disable receive
        pSocket->DisableEvents(CAsyncSocket::aeReceive);

    if (!pSocket->Create())
    {
        //Delete it
        delete pSocket;

        //Error
        return NULL;
    }
    else
    {
        //Set timeout
        if (GetConnectionTimeout())
            if (!pSocket->SetConnectionTimeout(GetConnectionTimeout()))
            {
                //Delete it
                delete pSocket;

                //Error
                return NULL;
            }

        //Done
        return pSocket;
    }
}
ERROR_HANDLER_RETURN("AllocateSocket",NULL)

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