有一小段代码不知道什么意思,大家看一下,知道的帮帮忙,谢谢
LRESULT CPublicNetSoftDlg::OnReadClose(WPARAM wParam,LPARAM lParam){//自定义的关闭与缓冲区有消息
if(!IsTrue)
{
list.InsertString(0,"有数据到达,但是没有工作站连接。");
}
CString str;
switch (WSAGETSELECTEVENT(lParam))
{
case FD_READ:
if(recv(Client,(char *)&msg,sizeof(msg),0) == SOCKET_ERROR)
{
list.InsertString(0,"接收数据发生错误。");
return 0;
}
str.Format("%s",msg.msg);
list.InsertString(0,str);
break;
case FD_CLOSE:
str = _T("工作站退出。");
list.InsertString(0,str);
closesocket(Client);
IsTrue = FALSE;
break;
}
return 0L;
}