How to make an action before or after a message is sent on The One Simulator?

30 Views Asked by At

I Want to implement TTR routing protocol in One Simulator, which requires a unique copy of the message, so every time a message is relayed, the sender node has to delete the message from its buffer.

Which method do i have to override to delete the message after it's sent?

I tried to override the sendMessage method from the MessageRouter Class, but it seems to never get called.

1

There are 1 best solutions below

0
Suvadip Batabyal On

Your router must extend the ActiveRouter class. In your defined class (possibly TTRRouter), you can call the getMessageCollection() function, which will return the list of the messages in your router buffer. You can then call the deleteMessage(messageId), to selectively remove/delete message from the buffer.