//测试数据我发了,但是接收不到有时候~
void CClientSocket::OnReceive(int nErrorCode)
{
do
{
CMsgPack msg;
msg.Serialize(*m_aSessionIn);
msg.m_pSocket = this;
m_RecvCF(&msg);
}
while(!m_aSessionIn->IsBufferEmpty()); // TODO: Add your specialized code here and/or call the base class CSocket::OnReceive(nErrorCode);
}
大神们帮助帮助我看下
void CClientSocket::OnReceive(int nErrorCode)
{
do
{
CMsgPack msg;
msg.Serialize(*m_aSessionIn);
msg.m_pSocket = this;
m_RecvCF(&msg);
}
while(!m_aSessionIn->IsBufferEmpty()); // TODO: Add your specialized code here and/or call the base class CSocket::OnReceive(nErrorCode);
}
大神们帮助帮助我看下
typedef void (*Call_Function)(CMsgPack* pMP);
Call_Function m_RecvCF;
补充下, 网络平时很少碰,专家们给点拨下吧
1. 用wireshark抓一下数据,确认对方发的数据是否到达本机的端口;
2. 下面地址有很多sockcet源码,你找一个与你的程序做一下互测试。如果别人的程序没问题,说明你的程序有错误。
http://download.csdn.net/detail/geoff08zhang/4571358