[Opentnl-general] BitStream as an RPC parameter?
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ville A. B. <vbe...@cc...> - 2005-04-19 16:32:41
|
Hi, I would like to use a BitStream as an RPC parameter. Since the OpenTNL RPCs already accept ByteBuffer parameters, I guess this should be possible, but what would be the safest way of doing it? On the calling side I can use void Send(XXX &myobject) { BitStream s; myobject.Write(s); connection->rpcSend(s); } but what about the receiving side? I was thinking of something like TNL_IMPLEMENT_RPC(MyConnection, rpcSend, (ByteBufferPtr buf), (buf), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) { BitStream s(buf->getBuffer(), buf->getBufferSize()); XXX myobject; myobject.Read(s); ... } Does this approach work, or am I completely on a wrong track here? Thanks in advance, Ville -- Ville Bergholm |