-/** @brief Conduct a RPC call
- *
- */
-void gras_msg_rpccall(gras_socket_t server,
- double timeOut,
- gras_msgtype_t msgtype,
- void *request, void *answer) {
+/** @brief Launch a RPC call, but do not block for the answer */
+gras_msg_cb_ctx_t
+gras_msg_rpc_async_call(gras_socket_t server,
+ double timeOut,
+ gras_msgtype_t msgtype,
+ void *request) {
+ gras_msg_cb_ctx_t ctx = xbt_new0(s_gras_msg_cb_ctx_t,1);
+
+ ctx->ID = last_msg_ID++;
+ ctx->expeditor = server;
+ ctx->msgtype=msgtype;
+ ctx->timeout=timeOut;
+
+ VERB5("Send to %s:%d a RPC of type '%s' (ID=%lu) (exception%s caught)",
+ gras_socket_peer_name(server),
+ gras_socket_peer_port(server),
+ msgtype->name,ctx->ID,
+ (__xbt_ex_ctx()->ctx_caught?"":" not"));
+
+ gras_msg_send_ext(server, e_gras_msg_kind_rpccall, ctx->ID, msgtype, request);
+
+ return ctx;
+}