End Google Ads 201810 - BS.net 01 --> Hi I am trying to create a server that would accept and receive message from multiple client. But i am receiving SOCKET_ERROR while my server seems to accept the multiple connection. Could anyone correct my code.
Here is the code I wrote..
CMysocket m_sListenSocket;
void CLocalDlg::OnAccept(void)
{
CMysocket *pSocket = new CMysocket;
if(m_sListenSocket.Accept(*pSocket))
MessageBox("Connection Accepted");
}

For receiving:
void CLocalDlg::OnReceive(void)
{

CMysocket *pSocket = new CMysocket;

char *pBuff = new char[1024];
int stlen = 1025;
int iRcvd;
iRcvd = pSocket->Receive(pBuff, stlen);
if(iRcvd ==SOCKET_ERROR)
MessageBox("Received socket error");
else
MessageBox("Message Received properly");
}