Protected Member Functions | |
virtual void | handleMessage (cMessage *msg) |
Sends back an acknowledgement -- or not.
void Toc8::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
Reimplemented from cSimpleModule.
00102 { 00103 if (uniform(0,1) < 0.1) 00104 { 00105 EV << "\"Losing\" message.\n"; 00106 bubble("message lost"); // making animation more informative... 00107 delete msg; 00108 } 00109 else 00110 { 00111 EV << "Sending back same message as acknowledgement.\n"; 00112 send(msg, "out"); 00113 } 00114 }