NetSendData() custom data/messages

On 10/11/2015 at 14:53, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   16 
Platform:   Windows  ;   
Language(s) :     C++  ;

Is it possible to send custom messages with NetSendData()? It seems like when I pass my own plugin
ID, I always get MESSAGERESULT_UNKNOWN error and the message is not sent to the TR server. Small

struct NetRenderMsgVbGi
  UInt size;
  Bool compute, wait;
NetRenderBuffer msg, result; = MSG_NETRENDER_VB_GI;
msg.job = vps->net->_renderJob->GetUuid();
msg.size = 0; = nullptr;
MESSAGERESULT res = NetSendData(
  vps->net->_service, vps->net->_renderJob->GetServerUuid(), &msg, &result, vps->thread);

Thanks in advance,

On 11/11/2015 at 02:30, xxxxxxxx wrote:


using R17 I have no problems using this code to send a message:

Int32* payload = NewObjClear(Int32, 1);  
*payload = 123;  
// prepare message  
NetRenderBuffer requestMessage;                        = MSG_CUSTOM;  
requestMessage.job                    = data->_vps->net->_renderJob->GetUuid();  
requestMessage.size                    = SIZEOF(Int32);                    = payload;  
NetRenderBuffer requestResult;                    = MSG_CUSTOM;  
requestResult.job                    = data->_vps->net->_renderJob->GetUuid();  
requestResult.size                = 0;                = nullptr;  
NetSendData(data->_vps->net->_service, data->_vps->net->_renderJob->GetServerUuid(), &requestMessage, &requestResult, data->_vps->thread);  
 Int32* res = (Int32* );  
 GePrint("Got data from server: " + String::IntToString(*res));  

best wishes,

On 11/11/2015 at 03:29, xxxxxxxx wrote:

Hi Sebastian, thanks for the example. Seems like you really need a payload, it doesn't work without here
in R16. Strangely, it works without payload for sending standard Net messages (eg. MSG_NETRENDER_BUCKET_INFO or ~_INDEX).

One thing I'm still wondering about though is about byte order. Won't there be issues with
machines that communicate with this interface and use a different byte order?


On 13/11/2015 at 00:25, xxxxxxxx wrote:


according to the developers, you are responsible for the endianess of the data chunk stored in NetRenderBuffer::data.

Best wishes,