The necessity of handleSelfMsg in BaseWaveApplLayer

眉间皱痕 提交于 2019-12-08 09:19:43

问题


I thought the handleSelfMsg in BaseWaveApplLayeris is same to tictoc self message which means a node sends message to itself but it looks not.

So what is the necessity of handleSelfMsg in BaseWaveApplLayer?


回答1:


As the name is indicating, the method handles any messages which a node sent to itself. Those "messages" are simple events in the sense of a DES and not of a networking message. Then a certain action is taken corresponding to the received self-message's type.

Here, this is either sending of a simple beacon message (BasicSafetyMessage) or of a service advertisement (WaveServiceAdvertisment) (both of them are actual network messages) and scheduling of an event (self-message) for sending the next message (network) after a certain interval.



来源:https://stackoverflow.com/questions/46393212/the-necessity-of-handleselfmsg-in-basewaveappllayer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!