im trying to send a kinect depthmap to an client via boost asio (without serializtion) is it better to try asynch or synch (for now my approach ist synch):
smthg like this..
server:
//depthmap
const XnDepthPixel* pDepthMap = depth.GetDepthMap();
boost::asio::write (socket, boost::asio::buffer (pDepthMap, sizeof(pDepthMap))); //sizeof isnt right..
client:
XnDepthPixel* depth;
socket.read_some( boost::asio::buffer (&depth, sizeof(XnDepthPixel)* ?? )); //send sizeof(pDepthMap) before..
EDIT: the definition of XnDepthPixel (also from OpenNI):
/** Defines the depth values type (16-bit values). **/
typedef XnUInt16 XnDepthPixel
and XnUInt16:
/** 16-bit unsigned integer. */
typedef unsigned short XnUInt16;
sizeof(pDepthMap)
is just size of the pointer, but what you actually want is to send some structure, not a pointer to it.
Please, take a look at ASIO Serialization example to see how it can be done using Boost.Serialization. If you don't want to use Boost.Serialization, you can "serialize" your structure by your own, in some proprietary way.