Class CUDPScanner::
CreateSniffer()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: AllocateSocketNext page: CSniffingSocket::CSniffingSocket    Show member index
Private Function Declared in:
UDPScanner.h

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

BOOL CreateSniffer();

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

Create the sniffer socket

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

try
{
    //Try to create the sniffer socket
    if (m_pSniffer)
    {
        delete m_pSniffer;
        m_pSniffer=NULL;
    }

    //Create it
    CSniffingSocket* pSocket;
    pSocket=new CSniffingSocket(this);

    //Protect it
    std::auto_ptr<CSniffingSocket> pProtection(pSocket);

    //Continue to create it
    if (!pSocket->Create())
    {
        //Report it
        ReportError("CreateSniffer","Failed to create sniffer");

        //Exit
        return FALSE;
    }

    //Try to bind it
    if (!pSocket->Bind(GetBindInterface(),0))
    {
        //Report it
        ReportError("CreateSniffer","Failed to bind sniffer");

        //Exit
        return FALSE;
    }

    //Release protection and save socket
    m_pSniffer=pProtection.release();

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

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

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