X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7928b6040b5a0427a8839b020a90e6906332ef92..8b21ab47f7af2ce3bb20bdce93d74a6b709c5580:/examples/gras/rpc/rpc.c diff --git a/examples/gras/rpc/rpc.c b/examples/gras/rpc/rpc.c index d98c40f2d1..94fe661cd8 100644 --- a/examples/gras/rpc/rpc.c +++ b/examples/gras/rpc/rpc.c @@ -53,7 +53,7 @@ static void exception_catching(void) { xbt_assert1(!strncmp(e.msg,"Some error we will catch on client side", strlen("Some error we will catch on client side")), "Got wrong message: %s", e.msg); - xbt_ex_free(&e); + xbt_ex_free(e); } } @@ -63,11 +63,11 @@ static void exception_catching(void) { int client(int argc,char *argv[]) { - xbt_ex_t e; + xbt_ex_t e; gras_socket_t toserver=NULL; /* peer */ gras_socket_t toforwarder=NULL; /* peer */ - + memset(&e,0,sizeof(xbt_ex_t)); int ping, pong, i; volatile int gotit=0; @@ -144,7 +144,7 @@ int client(int argc,char *argv[]) { strlen("Some error we will catch on client side")), "Got wrong message: %s", e.msg); INFO0("Got the expected exception when calling the exception raising RPC"); - xbt_ex_free(&e); + xbt_ex_free(e); } if (!gotit) @@ -162,7 +162,7 @@ int client(int argc,char *argv[]) { gras_msgtype_by_name("raise exception"), NULL, NULL); } CATCH(e) { gotit = 1; - xbt_ex_free(&e); + xbt_ex_free(e); } if (!gotit) { THROW0(unknown_error,0,"Didn't got the remote exception!"); @@ -190,12 +190,13 @@ int client(int argc,char *argv[]) { "Got wrong category: %d (instead of %d)", e.category,unknown_error); INFO0("Got the expected exception when calling the exception raising RPC"); - xbt_ex_free(&e); + xbt_ex_free(e); exception_catching(); } gras_msg_send(toserver,gras_msgtype_by_name("kill"),NULL); gras_msg_send(toforwarder,gras_msgtype_by_name("kill"),NULL); + gras_os_sleep(1); /* give peer a chance to get the message before closing the socket */ /* 11. Cleanup the place before leaving */ gras_socket_close(toserver);