Well am trying to create a port scanner for which am trying to create a socket first and then trying to connect at that particular port but the problem is every time i try to create a socket it returns false.......please help as soon as possible......
Code:
BOOL CTrial1Dlg::test (CString IP,UINT nPort)
{
	
	sock* pSocket;
	pSocket = new sock;
	ASSERT(pSocket);
	if (!pSocket->Create())
	{
		delete pSocket;
		pSocket = NULL;
		MessageBox("hmmm");
		return FALSE;
	}
	
	while (!pSocket->Connect(IP , nPort))
		{
		delete pSocket;
		pSocket = NULL;
		return FALSE;
	}
	pSocket->Close();
	delete pSocket;
	return TRUE;
}
above sock is a simple class derived from CSocket class.....