#include "gras/Msg/msg_private.h"
-//XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_rpc,gras_msg,"RPCing");
-
xbt_set_t _gras_rpctype_set = NULL;
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_rpc,gras_msg,"RPC mecanism");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_msg_rpc,gras_msg,"RPC mecanism");
/** @brief declare a new versionned RPC type of the given name and payloads
void *request) {
gras_msg_cb_ctx_t ctx = xbt_new0(s_gras_msg_cb_ctx_t,1);
+ if (msgtype->ctn_type) {
+ xbt_assert1(request,
+ "RPC type '%s' convey a payload you must provide",
+ msgtype->name);
+ } else {
+ xbt_assert1(!request,
+ "No payload was declared for RPC type '%s'",
+ msgtype->name);
+ }
+
ctx->ID = last_msg_ID++;
ctx->expeditor = server;
ctx->msgtype=msgtype;
void *answer) {
s_gras_msg_t received;
+ if (ctx->msgtype->answer_type) {
+ xbt_assert1(answer,
+ "Answers to RPC '%s' convey a payload you must accept",
+ ctx->msgtype->name);
+ } else {
+ xbt_assert1(!answer,
+ "No payload was declared for answers to RPC '%s'",
+ ctx->msgtype->name);
+ }
+
gras_msg_wait_ext(ctx->timeout,
ctx->msgtype, NULL, msgfilter_rpcID, &ctx->ID,
&received);
__xbt_ex_ctx()->ctx_ex.remote = 1;
__xbt_ex_ctx()->ctx_ex.host = e.host;
__xbt_ex_ctx()->ctx_ex.procname = e.procname;
+ __xbt_ex_ctx()->ctx_ex.pid = e.pid;
__xbt_ex_ctx()->ctx_ex.file = e.file;
__xbt_ex_ctx()->ctx_ex.line = e.line;
__xbt_ex_ctx()->ctx_ex.func = e.func;