> Just to make this point clear: The "write-to-odb-read-via-hotlink" was never meant to guarantee the receiving side to see each change. If changes happen too often, updates might get lost. If one relies on the
> sequence of updates, one should use direct RPC calls to the frontend or use a midas buffer and encode updates in events.
It passes 2 strings as arguments (command and data value). Arbitrary objects can be passed by encoding
arbitrary data as json, use the mjson.h library).
Example of all this is in example.html and fetest.cxx:
frontend side code:
INT rpc_callback(INT index, void *prpc_param)
const char* cmd = CSTRING(0);
const char* args = CSTRING(1);
char* return_buf = CSTRING(2);
int return_max_length = CINT(3);
cm_msg(MINFO, "rpc_callback", "--------> rpc_callback: index %d, max_length %d, cmd [%s], args [%s]", index, return_max_length, cmd, args);
... do stuff ... put result into string "tmp"
strlcpy(return_buf, tmp, return_max_length);
... somewhere in frontend_init(), register the RPC:
status = cm_register_function(RPC_JRPC, rpc_callback);
assert(status == SUCCESS);