From 6e346fa06674c164758dc7b1951e06975d70229e Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 18 Jun 2004 18:00:00 +0000 Subject: [PATCH] Implement select over SG (badly since there is so few support within SG); Add stupid implementation of the RL plugins to use when in SG mode git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@111 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/Transport/sg_transport.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/gras/Transport/sg_transport.c b/src/gras/Transport/sg_transport.c index b7eee02613..f6e3f05791 100644 --- a/src/gras/Transport/sg_transport.c +++ b/src/gras/Transport/sg_transport.c @@ -9,6 +9,8 @@ under the terms of the license (GNU LGPL) which comes with this package. */ #include "Transport/transport_private.h" +#include + //GRAS_LOG_EXTERNAL_CATEGORY(transport); //GRAS_LOG_DEFAULT_CATEGORY(transport); @@ -27,5 +29,30 @@ gras_error_t gras_trp_select(double timeout, gras_socket_t **dst) { - RAISE_UNIMPLEMENTED; + double startTime=gras_time(); + gras_procdata_t *pd=gras_procdata_get(); + + do { + if (MSG_task_Iprobe((m_channel_t) pd->chan)) { + *dst = pd->sock; + + return no_error; + } else { + MSG_process_sleep(0.001); + } + } while (gras_time()-startTime < timeout + || MSG_task_Iprobe((m_channel_t) pd->chan)); + + return timeout_error; + +} + + +/* dummy implementations of the functions used in RL mode */ + +gras_error_t gras_trp_tcp_setup(gras_trp_plugin_t *plug) { + return mismatch_error; +} +gras_error_t gras_trp_file_setup(gras_trp_plugin_t *plug) { + return mismatch_error; } -- 2.20.1