X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8c354c48ec90c997cc7213ce96ca97d882934166..74645bf17655057b81ab984d4ecf77e1f7968b67:/examples/ping/ping.c diff --git a/examples/ping/ping.c b/examples/ping/ping.c index 77c43cfa36..460e30400e 100644 --- a/examples/ping/ping.c +++ b/examples/ping/ping.c @@ -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; }