cmRtNet.h/c : Sync. messages are now transmitted to the client

in _cmRtNetRecv().
Added comments.
这个提交包含在:
Kevin Larke 2014-06-14 13:54:30 -07:00
父节点 4cd59919a2
当前提交 4df91dd08f
共有 2 个文件被更改,包括 6 次插入2 次删除

查看文件

@ -608,13 +608,14 @@ cmRtNetRC_t _cmRtNetSyncModeRecv( cmRtNet_t* p, const char* data, unsigned data
return rc;
}
// This is called in the context of cmRtNetReceive().
void _cmRtNetRecv( void* cbArg, const char* data, unsigned dataByteCnt, const struct sockaddr_in* fromAddr )
{
cmRtNet_t* p = (cmRtNet_t*)cbArg;
if( _cmRtNetIsSyncModeMsg(data,dataByteCnt))
_cmRtNetSyncModeRecv(p,data,dataByteCnt,fromAddr);
else
// else
p->cbFunc(p->cbArg,data,dataByteCnt,fromAddr);
}
@ -707,6 +708,7 @@ cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h )
cmRtNetRC_t rc = kOkNetRC;
cmRtNet_t* p = _cmRtNetHandleToPtr(h);
// Calling this function results in callbacks to _cmRtNetRecv() (above)
if( cmUdpGetAvailData(p->udpH, NULL, NULL, NULL ) != kOkUdpRC )
{
cmErrMsg(&p->err,kUdpPortFailNetRC,"UDP port query failed.");

查看文件

@ -65,7 +65,9 @@ extern "C" {
cmRtNetRC_t cmRtNetDoSync( cmRtNetH_t h );
// This function must be polled to receive incoming network messages
// via the callback funcion 'cbFunc' as passed to cmRtNetAlloc()
// via the callback funcion 'cbFunc' as passed to cmRtNetAlloc().
// Note that all messages received via 'cbFunc' will be prefixed with
// an cmRtNetMsg_t header (See cmRtSysMsg.h).
cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h );
// Get an end point handle for use with cmRtNetSend.