How to implement timers that periodically execute a defined callback function without any timeout ?

38 views
Skip to first unread message

Andris Skrastins

unread,
Jul 31, 2014, 1:26:59 AM7/31/14
to omn...@googlegroups.com
How to implement timers that periodically execute a defined callback function without any timeout ?

Alex Berger

unread,
Jul 31, 2014, 3:08:58 AM7/31/14
to omn...@googlegroups.com
You could create a cMessage and send it to yourself with scheduleAt(...)
There should be lots of examples in the existing code.

Andris Skrastins

unread,
Jul 31, 2014, 4:36:58 AM7/31/14
to omn...@googlegroups.com
I try to implement a function or triggering that check one function periodically, but in such a way that does not affect the simulation base process (IP packet forwarding). I try to create new connection admission control for IP networks.
If I use scheduleAt(simTime()+timeout, timeoutEvent) - my packets forwrding are stopped every defined 'simTime()+timeout'


--
You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/nnt7fzLLj-Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rudolf Hornig

unread,
Jul 31, 2014, 5:26:41 AM7/31/14
to omn...@googlegroups.com


On Thursday, 31 July 2014 10:36:58 UTC+2, Andris Skrastins wrote:
I try to implement a function or triggering that check one function periodically, but in such a way that does not affect the simulation base process (IP packet forwarding). I try to create new connection admission control for IP networks.
If I use scheduleAt(simTime()+timeout, timeoutEvent) - my packets forwrding are stopped every defined 'simTime()+timeout'

I don't see why packet forwarding would be affected at all by introducing a new timer event? It should be totally independent of the rest if the IP processing code. 


2014-07-31 10:08 GMT+03:00 Alex Berger <zat...@gmail.com>:
You could create a cMessage and send it to yourself with scheduleAt(...)
There should be lots of examples in the existing code.



On Thursday, July 31, 2014 7:26:59 AM UTC+2, Andris Skrastins wrote:
How to implement timers that periodically execute a defined callback function without any timeout ?

--
You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/nnt7fzLLj-Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+unsubscribe@googlegroups.com.

Andris Skrastins

unread,
Jul 31, 2014, 8:51:01 AM7/31/14
to omn...@googlegroups.com
Yes, thanks, I solved the problem.


To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages