基于vc/mfc Winsock聊天室程序中当关闭服务器对话框调用的响应窗口的WM_DESTROY消息函数OnDestroy()
void CChatServerDlg::OnStopServer()
{     CDialog::OnDestroy();
CDialog::OnDestroy();
delete m_pSocket;
m_pSocket=NULL;
//向消息列表天消息
CString strTemp;
strTemp="服务器终止服务!";
m_msgList.AddTail((LPCTSTR)strTemp);
//对链接列表进行处理
while(!m_connectionList.IsEmpty())
{
//向每一个链接的客户机发送“服务器终止服务!"的消息
//并逐个删除已建立的链接
CClientSocket  *pSocket=(CClientSocket *)m_connectionList.RemoveHead();
CMsg *pMsg=AssembleMsg(pSocket);     
pMsg->m_bClose=TRUE;
                  SendMsg(pSocket,pMsg);
if(!pSocket->IsAborted())
{
pSocket->ShutDown();   
                           BYTE Buffer[50];
while(pSocket->Receive(Buffer,50)>0);
//If no error occurs, Receive returns the number of bytes received
delete pSocket;
}
}
//删除消息列表
m_msgList.RemoveAll();
}我的问题是:代码段中while(pSocket->Receive(Buffer,50)>0);起到的作用??个人感觉好像没什么作用。谢谢关注!