X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2539fff313cbd67c45b8490f7961e45e358d9ba2..74645bf17655057b81ab984d4ecf77e1f7968b67:/examples/ping/ping.c?ds=sidebyside diff --git a/examples/ping/ping.c b/examples/ping/ping.c index b58078d0de..460e30400e 100644 --- a/examples/ping/ping.c +++ b/examples/ping/ping.c @@ -2,11 +2,10 @@ /* ping - ping/pong demo of GRAS features */ -/* Authors: Martin Quinson */ -/* Copyright (C) 2003 the OURAGAN project. */ +/* 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. */ + * under the terms of the license (GNU LGPL) which comes with this package. */ #include #include @@ -87,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) { @@ -117,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; } @@ -146,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) { @@ -195,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; }