2008-10-02 21:18:59 +00:00
|
|
|
/* Only handle receive messages */
|
|
|
|
if (!msg.contains('received')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-11-11 15:17:44 +00:00
|
|
|
/* Count received packets */
|
|
|
|
result = global.get("recv_" + id);
|
|
|
|
if (result == null) {
|
|
|
|
result = 0;
|
|
|
|
}
|
|
|
|
result++;
|
|
|
|
global.put("recv_" + id, result);
|
|
|
|
log.log(id + " received " + result + " messages\n");
|
2008-10-02 21:18:59 +00:00
|
|
|
|
|
|
|
/* Did all nodes (1 and 2) receive a message? */
|
|
|
|
for (i = 1; i <= 2; i++) {
|
|
|
|
result = global.get("recv_" + i);
|
|
|
|
if (result == null) {
|
|
|
|
return;
|
|
|
|
}
|
2008-11-11 15:17:44 +00:00
|
|
|
if (result < 30) {
|
|
|
|
return;
|
|
|
|
}
|
2008-10-02 21:18:59 +00:00
|
|
|
}
|
|
|
|
|
2008-11-11 15:17:44 +00:00
|
|
|
log.log("Node 1 received " + global.get("recv_1") + " messages\n");
|
|
|
|
log.log("Node 2 received " + global.get("recv_2") + " messages\n");
|
|
|
|
log.testOK(); /* Report test success */
|