Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix make dist
[simgrid.git] / examples / ping / ping.c
index d43603b..39ca8dd 100644 (file)
@@ -126,10 +126,10 @@ int server (int argc,char *argv[]) {
   
   if (!gras_if_RL())
     gras_sleep(5,0);
-  INFO0("SERVER: Done.");
   gras_socket_close(g->sock);
   free(g);
   gras_exit();
+  INFO0("SERVER: Done.");
   return no_error;
 }
 
@@ -164,7 +164,7 @@ int client(int argc,char *argv[]) {
     port=atoi(argv[2]);
   } 
 
-  fprintf(stderr,"Launch client (server on %s:%d)",host,port);
+  INFO2("Launch client (server on %s:%d)",host,port);
   if (!gras_if_RL())
     gras_sleep(5,0); /* Wait for the server to be setup */
   if ((errcode=gras_socket_client(host,port,&(g->sock)))) {
@@ -208,6 +208,7 @@ int client(int argc,char *argv[]) {
 
   gras_socket_close(g->sock);
   free(g);
+  gras_exit();
   INFO0("Client: Done.");
   return 0;
 }