/* 5. Send the token as payload of a stoken message to the successor */
TRY {
- gras_msg_send(globals->tosuccessor,
- gras_msgtype_by_name("stoken"), &msg);
+ gras_msg_send(globals->tosuccessor, "stoken", &msg);
/* 6. Deal with errors */
} CATCH(e) {
}
/* 9. Tell GRAS that we consummed this message */
- return 1;
+ return 0;
} /* end_of_node_cb_stoken_handler */
int node (int argc,char *argv[]) {
globals->tosuccessor = NULL;
if (!gras_os_getpid() % 100)
- INFO4("Launch node %ld (successor on %s:%d; listening on %d)",
+ INFO4("Launch node %d (successor on %s:%d; listening on %d)",
gras_os_getpid(), host,peerport, myport);
/* 4. Create my master socket for listening */
/* 8. One node has to create the token at startup.
It's specified by a command line argument */
- if (argc >= 5 && !strncmp("--create-token", argv[4],strlen(argv[4])))
+ if (argc >= 5 && !strncmp("--create-token", argv[4],strlen("--create-token")))
globals->create=1;
if (globals->create) {
token, host, peerport);
TRY {
- gras_msg_send(globals->tosuccessor,
- gras_msgtype_by_name("stoken"), &token);
+ gras_msg_send(globals->tosuccessor, "stoken", &token);
} CATCH(e) {
RETHROW0("Unable to send the freshly created token: %s");
}