![]() |
CreateSniffer() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Private Function |
Declared in: UDPScanner.h |
BOOL CreateSniffer();
Create the sniffer socket
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)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |