If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR ……
[/Quote]
CMySocket m_ReceiveMessage;
while(true)
{
TCHAR* pBuffer = new TCHAR[1024];
m_ReceiveMessage.Receive(pBuffer,sizeof(pBuffer));
::SendMessage((HWND)pParam,WM_RECEIVE_MESSAGE,(WPARAM)pBuffer,0);
}
我这样写有问题么?
If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.