![]() |
NewSocket() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Protected Function |
Declared in: TCPPortScanner.h |
DeclarationBOOL NewSocket();
DescriptionCreate a new socket
Function Body
try
{
//Are we done
if (m_bDone ||
m_bFinished)
return TRUE;
//Get a port
unsigned short usPort;
usPort=GetNextPort();
//Do we have it
if (!usPort)
{
//Are we done
if (AdjustNumberOfSockets(-1)<=0)
ScanDone(FALSE);
//Exit
return TRUE;
}
//Create the socket
CTCPSocketAsync* pSocket;
pSocket=AllocateSocket(usPort);
//Create it
if (!pSocket)
{
//Are we done
if (AdjustNumberOfSockets(-1)<=0 &&
!CanScan())
{
//Run the scan
ScanDone(FALSE);
//Exit
return TRUE;
}
else
return FALSE;
}
//Connect it
if (!pSocket->Connect(0,
m_aTarget,
usPort))
{
//Dispose the socket
DestroySocket(pSocket);
//Are we done
if (AdjustNumberOfSockets(-1)<=0 &&
!CanScan())
{
//Run the scan
ScanDone(FALSE);
//Exit
return TRUE;
}
else
return FALSE;
}
//We scanned the port
PortScanned(usPort);
//Done
return TRUE;
}
ERROR_HANDLER_RETURN("NewSocket",FALSE)
See Also
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. |