Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move Virtu functions into the gras_os_ namespace
[simgrid.git] / examples / ping / ping.c
index 5724135..aa7ad2f 100644 (file)
@@ -30,10 +30,9 @@ gras_error_t register_messages(void);
 /* Code */
 gras_error_t register_messages(void) {
   gras_error_t errcode;
-  gras_msgtype_t *msg_t; /* FIXME: not needed */
 
-  TRY(gras_msgtype_declare("ping", gras_datadesc_by_name("int"), &msg_t));
-  TRY(gras_msgtype_declare("pong", gras_datadesc_by_name("int"), &msg_t));
+  TRY(gras_msgtype_declare("ping", gras_datadesc_by_name("int")));
+  TRY(gras_msgtype_declare("pong", gras_datadesc_by_name("int")));
 
   return no_error;
 }
@@ -122,7 +121,7 @@ int server (int argc,char *argv[]) {
   if (g->endcondition)
   
   if (!gras_if_RL())
-    gras_sleep(5,0);
+    gras_os_sleep(5,0);
   gras_socket_close(g->sock);
   free(g);
   gras_exit();
@@ -162,8 +161,7 @@ int client(int argc,char *argv[]) {
   } 
 
   INFO2("Launch client (server on %s:%d)",host,port);
-  if (!gras_if_RL())
-    gras_sleep(5,0); /* Wait for the server to be setup */
+  gras_os_sleep(5,0); /* Wait for the server to be setup */
   if ((errcode=gras_socket_client(host,port,&(g->sock)))) {
     ERROR1("Client: Unable to connect to the server. Got %s",
           gras_error_name(errcode));