|
沙发
楼主 |
发表于 2022-7-16 12:39:07
|
只看该作者
本帖最后由 urenai 于 2022-7-16 12:45 编辑
还是希望更新一下,给接收事件,添加对方IP+PORT
- void CUDPSocketObject::OnFilterMessage (UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- if (m_pSocketInterface == NULL)
- return;
- if (uMsg == _VSM_DATA_INCOMING && m_hSock != INVALID_SOCKET)
- {
- INT nSize;
- if (ioctlsocket (m_hSock, FIONREAD, (u_long*)&nSize) == 0)
- {
- nSize = MAX (1, nSize);
- CVolMem mem;
- BYTE* p = mem.Alloc (nSize);
- nSize = recvfrom (m_hSock, (char*)p, nSize, 0, NULL, NULL);
- if (nSize != SOCKET_ERROR && nSize > 0)
- {
- mem.Realloc (nSize);
- m_pSocketInterface->OnRecvPeerData (mem);
- }
- }
- }
- }
复制代码
应该是这一段。在 m_pSocketInterface->OnRecvPeerData ( , ,mem);
|
|