BOOL CenumhostsDlg::TestConnection(CString IP, UINT nPort)
{
CSocket* pSocket;
pSocket=new CSocket();
ASSERT(pSocket);
if(!pSocket->Create())
{
delete pSocket;
pSocket=NULL;
return false;
}
while(!pSocket->Connect(IP,nPort))
{
delete pSocket;
pSocket=NULL;
return false;
}
pSocket->Close();
delete pSocket;
return true;
}