CSocket Accept() method HELP!!

DimSum

New Member
hi all.

I keep getting an Access Violation when I try to call the Accept() method with CSocket.

I'm overriding the OnAccept() method and when a client trys to connect it gets called. And then when I actually try to Accept() the socket it fails...
Here's what I have:

void CServerSocket::vfnProcessPendingAccept()
{
CSocket* clientSocket = new CSocket();
if ( m_pSocket->Accept(*clientSocket) ) // FAILS here!
TRACE ("Socket accepted by server.\n");
else
TRACE ("Socket NOT accepted by server.\n");
}

The above is called after an OnAccept().
The program fails on the Accept() call and says there is an Access Violation. Can anyone help me??

thanks

-Phil
 
Top