A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autogenerated files (sorry)
[simgrid.git]
/
examples
/
gras
/
ping
/
ping_server.c
diff --git
a/examples/gras/ping/ping_server.c
b/examples/gras/ping/ping_server.c
index
e59dee2
..
3e8b95b
100644
(file)
--- a/
examples/gras/ping/ping_server.c
+++ b/
examples/gras/ping/ping_server.c
@@
-39,7
+39,7
@@
static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload) {
msg = 4321;
/* 5. Send it back as payload of a pong message to the expeditor */
TRY {
msg = 4321;
/* 5. Send it back as payload of a pong message to the expeditor */
TRY {
- gras_msg_send(expeditor,
gras_msgtype_by_name("pong")
, &msg);
+ gras_msg_send(expeditor,
"pong"
, &msg);
/* 6. Deal with errors: add some details to the exception */
} CATCH(e) {
/* 6. Deal with errors: add some details to the exception */
} CATCH(e) {
@@
-51,12
+51,9
@@
static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload) {
/* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
globals->endcondition = 1;
/* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
globals->endcondition = 1;
-
- /* 8. Make sure we don't leak sockets */
- gras_socket_close(expeditor);
-
- /* 9. Tell GRAS that we consummed this message */
- return 1;
+
+ /* 8. Tell GRAS that we consummed this message */
+ return 0;
} /* end_of_server_cb_ping_handler */
int server (int argc,char *argv[]) {
} /* end_of_server_cb_ping_handler */
int server (int argc,char *argv[]) {
@@
-90,7
+87,7
@@
int server (int argc,char *argv[]) {
globals->endcondition=0;
/* 6. Wait up to 10 minutes for an incomming message to handle */
globals->endcondition=0;
/* 6. Wait up to 10 minutes for an incomming message to handle */
- gras_msg_handle(
6
0.0);
+ gras_msg_handle(
1
0.0);
/* 7. Housekeeping */
if (!globals->endcondition)
/* 7. Housekeeping */
if (!globals->endcondition)
@@
-99,8
+96,8
@@
int server (int argc,char *argv[]) {
/* 8. Free the allocated resources, and shut GRAS down */
gras_socket_close(globals->sock);
free(globals);
/* 8. Free the allocated resources, and shut GRAS down */
gras_socket_close(globals->sock);
free(globals);
+ INFO0("Done.");
gras_exit();
gras_exit();
- INFO0("Done.");
return 0;
} /* end_of_server */
return 0;
} /* end_of_server */