X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4a201b7ceece70d2bc461ac48c8b746a36d07243..0f5e8daaa6e9f74521068aa75837200bcd182ea6:/src/gras/Msg/rl_msg.c diff --git a/src/gras/Msg/rl_msg.c b/src/gras/Msg/rl_msg.c index 7a277cb91f..25860b070c 100644 --- a/src/gras/Msg/rl_msg.c +++ b/src/gras/Msg/rl_msg.c @@ -1,6 +1,7 @@ /* messaging - Function related to messaging code specific to RL */ -/* Copyright (c) 2003-2005 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2005, 2006, 2007, 2009, 2010. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -14,6 +15,17 @@ XBT_LOG_EXTERNAL_CATEGORY(gras_msg); XBT_LOG_DEFAULT_CATEGORY(gras_msg); +void gras_msg_recv(gras_socket_t sock, gras_msg_t msg); + +gras_msg_t gras_msg_recv_any(void) +{ + gras_msg_t msg = xbt_new0(s_gras_msg_t, 1); + msg->expe = gras_trp_select(-1); + DEBUG0("Select returned something"); + gras_msg_recv(msg->expe, msg); + return msg; +} + void gras_msg_send_ext(gras_socket_t sock, e_gras_msg_kind_t kind, unsigned long int ID, @@ -106,7 +118,8 @@ void gras_msg_recv(gras_socket_t sock, gras_msg_t msg) msg->kind = (e_gras_msg_kind_t) c_kind; } CATCH(e) { - RETHROW0("Exception caught while trying to get the mesage header: %s"); + RETHROW0 + ("Exception caught while trying to get the message header: %s"); } for (cpt = 0; cpt < 4; cpt++) @@ -135,13 +148,13 @@ void gras_msg_recv(gras_socket_t sock, gras_msg_t msg) gras_datadesc_recv(sock, string_type, r_arch, &msg_name); DEBUG4 - ("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)", - msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4], - gras_datadesc_arch_name(r_arch)); + ("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)", + msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4], + gras_datadesc_arch_name(r_arch)); TRY { msg->type = - (gras_msgtype_t) xbt_set_get_by_name(_gras_msgtype_set, msg_name); + (gras_msgtype_t) xbt_set_get_by_name(_gras_msgtype_set, msg_name); } CATCH(e) { /* FIXME: Survive unknown messages */ if (e.category == not_found_error) { @@ -151,8 +164,8 @@ void gras_msg_recv(gras_socket_t sock, gras_msg_t msg) msg_name); } else RETHROW1 - ("Exception caught while retrieving the type associated to messages '%s' : %s", - msg_name); + ("Exception caught while retrieving the type associated to messages '%s' : %s", + msg_name); } free(msg_name);