Protected Member Functions | |
virtual void | handleMessage (cMessage *msg) |
Sends back an acknowledgement -- or not.
void Toc9::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
Reimplemented from cSimpleModule.
00124 { 00125 if (uniform(0,1) < 0.1) 00126 { 00127 EV << "\"Losing\" message " << msg << endl; 00128 bubble("message lost"); 00129 delete msg; 00130 } 00131 else 00132 { 00133 EV << msg << " received, sending back an acknowledgement.\n"; 00134 delete msg; 00135 send(new cMessage("ack"), "out"); 00136 } 00137 }