X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/58bce89d599a5bee49318c168f54fb407fbf5d24..7d8d2388509cb9a579d70b91b9a512e882132558:/doc/gtut-files/08-exceptions.c diff --git a/doc/gtut-files/08-exceptions.c b/doc/gtut-files/08-exceptions.c index fd3a407dbb..6b90168abe 100644 --- a/doc/gtut-files/08-exceptions.c +++ b/doc/gtut-files/08-exceptions.c @@ -1,3 +1,9 @@ +/* Copyright (c) 2006, 2007, 2010. The SimGrid Team. + * 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. */ + #include XBT_LOG_NEW_DEFAULT_CATEGORY(test,"My little example"); @@ -16,7 +22,7 @@ int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload) { globals->killed = 1; - return 1; + return 0; } /* end_of_kill_callback */ int server(int argc, char *argv[]) { @@ -29,7 +35,7 @@ int server(int argc, char *argv[]) { globals->killed=0; gras_msgtype_declare("kill", NULL); - gras_cb_register(gras_msgtype_by_name("kill"),&server_kill_cb); + gras_cb_register("kill",&server_kill_cb); if (argc>1 && !strcmp(argv[1],"--cheat")) { mysock = gras_socket_server(9999); @@ -65,7 +71,7 @@ int client(int argc, char *argv[]) { for (port=3000, found=0; port<3010 && !found; port++) { TRY { toserver = gras_socket_client(argv[1], port); - gras_msg_send(toserver,gras_msgtype_by_name("kill"), NULL); + gras_msg_send(toserver,"kill", NULL); gras_socket_close(toserver); found = 1; INFO1("Yeah! I found the server on %d! It's eradicated by now.",port);