Beispiel #1
0
XnStatus XnServerSession::HandleOpenStream()
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	// read it
	XnChar strStreamName[XN_DEVICE_MAX_STRING_LENGTH];
	XnUInt32 nDataSize = XN_DEVICE_MAX_STRING_LENGTH;
	XnUInt32 nType = XN_SENSOR_SERVER_MESSAGE_OPEN_STREAM;
	nRetVal = m_privateIncomingPacker.ReadCustomData(nType, strStreamName, &nDataSize);
	XN_IS_STATUS_OK(nRetVal);

	XnStatus nActionResult = OpenStreamImpl(strStreamName);

	nRetVal = SendReply(XN_SENSOR_SERVER_MESSAGE_GENERAL_OP_RESPOND, nActionResult);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
XnStatus XnServerSession::HandleOpenStream()
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	// read it
	XnChar strStreamName[XN_DEVICE_MAX_STRING_LENGTH];
	XnUInt32 nDataSize = XN_DEVICE_MAX_STRING_LENGTH;
	XnUInt32 nType = XN_SENSOR_SERVER_MESSAGE_OPEN_STREAM;
	nRetVal = m_privateIncomingPacker.ReadCustomData(nType, strStreamName, &nDataSize);
	XN_IS_STATUS_OK(nRetVal);

	XnStatus nActionResult = OpenStreamImpl(strStreamName);
	if (nActionResult != XN_STATUS_OK)
	{
		xnLogWarning(XN_MASK_SENSOR_SERVER, "Client %u failed to open stream '%s': %s", m_nID, strStreamName, xnGetStatusString(nActionResult));
	}

	nRetVal = SendReply(XN_SENSOR_SERVER_MESSAGE_GENERAL_OP_RESPOND, nActionResult);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}