Skip to main content

Exercise 2: Resend the message

Now, let's us resend the message to ourselves. In handleMessage(), instead of deleting the message, add the following code:

scheduleAt(simTime()+10, msg);

This line of code sends the same message back to the kernel to be fired 10 seconds after now (simTime() returns the "now" and we add 10 to it). Remember: you can only schedule events in the future!

Re-run the simulation and observe - what happens?