Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use gras_exit, not only xbt_exit
[simgrid.git] / examples / ping / ping.c
index 77c43cf..460e304 100644 (file)
@@ -2,7 +2,7 @@
 
 /* ping - ping/pong demo of GRAS features                                   */
 
-/* Copyright (c) 2004 Martin Quinson. All rights reserved.                  */
+/* Copyright (c) 2003, 2004 Martin Quinson. 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. */
@@ -86,7 +86,7 @@ int server (int argc,char *argv[]) {
 
   int port = 4000;
   
-  xbt_init(&argc,argv);
+  gras_init(&argc,argv, NULL);
   g=gras_userdata_new(server_data_t);
    
   if (argc == 2) {
@@ -116,9 +116,10 @@ int server (int argc,char *argv[]) {
   
   if (!gras_if_RL())
     gras_os_sleep(1,0);
+
   gras_socket_close(g->sock);
   free(g);
-  xbt_exit();
+  gras_exit();
   INFO0("SERVER: Done.");
   return no_error;
 }
@@ -145,7 +146,7 @@ int client(int argc,char *argv[]) {
   const char *host = "127.0.0.1";
         int   port = 4000;
 
-  xbt_init(&argc, argv);
+  gras_init(&argc, argv, NULL);
   g=gras_userdata_new(client_data_t);
    
   if (argc == 3) {
@@ -194,7 +195,7 @@ int client(int argc,char *argv[]) {
 
   gras_socket_close(g->sock);
   free(g);
-  xbt_exit();
+  gras_exit();
   INFO0("Client: Done.");
   return 0;
 }