:670.068KB : :1 :2022-10-09 16:12:28
socket通讯(客户端接收服务端数据)如果开发者对于本文件有需要的可以参考。
客户端socket
int CClient::ReceiveData()
{
if (m_hSocket == INVALID_SOCKET)
return -1;
//stru_TestData dataFrame;
//memset(&dataFrame,0,sizeof(stru_TestData));
//_DATA dataFrame;
_PACKET dataFrame;
memset(&dataFrame, 0, sizeof(_PACKET));
int nResult = recv(m_hSocket, (char*)&dataFrame, sizeof(_PACKET), 0);
std::cout << "The data RECV:" << dataFrame.title
<< dataFrame.MW35.type << dataFrame.MW35.number << dataFrame.MW35.value
<< dataFrame.M34.type << dataFrame.M34.number << dataFrame.M34.value
<< dataFrame.M45.type << dataFrame.M45.number << dataFrame.M45.value
<< dataFrame.M215.type << dataFrame.M215.number << dataFrame.M215.value
<< dataFrame.end << "\n";
if (nResult != sizeof(_PACKET))
return -1;
return 0;
}
02-02驱动键鼠的硬件USB通讯
01-09基于HPSocket写的一个对接api
01-06KCP快速可靠通讯协议,可靠UDP
01-02winhttp版WebSocket源码
12-30HPSocket版的卡密网络验证