本文整理汇总了C++中network::getData方法的典型用法代码示例。如果您正苦于以下问题:C++ network::getData方法的具体用法?C++ network::getData怎么用?C++ network::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类network
的用法示例。
在下文中一共展示了network::getData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void *serverData(void *arg)
{
int len = 8*10;
unsigned char *buff = (unsigned char*)malloc(len); // Command buffer
while(g_Connected)
{
len = g_AS3Network.getData(buff, 1024);
if(len > 0 && len % 6 == 0)
{
// Get the number of commands received.
int max = len / 6;
int i;
// For each command received.
for(i = 0; i < max; i++)
{
int code = buff[0 + (i*6)];
switch(code)
{
case 1: // OPENNI
switch(buff[1 + (i*6)])
{
case 0: // GET DEPTH
if(_featureDepthMapCapture) g_AS3Network.sendMessage(1,0,g_ucDepthBuffer,sizeof(g_ucDepthBuffer));
break;
case 1: // GET RGB
if(_featureRGBCapture) g_AS3Network.sendMessage(1,1,g_ucImageBuffer,sizeof(g_ucImageBuffer));
break;
#if (XN_PLATFORM == XN_PLATFORM_WIN32)
case 4: // GET USERS
if(_featureUserTracking)
{
for (int i = 0; i < MAX_USERS; ++i)
{
g_AS3Network.sendMessage(1,4,g_ucPlayersBuffer[i].data,g_ucPlayersBuffer[i].size);
}
}
break;
case 5: // GET SKELETONS
if(_featureUserTracking)
{
for (int i = 0; i < MAX_USERS; ++i)
{
g_AS3Network.sendMessage(1,5,g_ucSkeletonsBuffer[i].data,g_ucSkeletonsBuffer[i].size);
}
}
break;
#endif
}
break;
}
}
}
}
return 0;
}