Process message function in module

24 views
Skip to first unread message

Alessandro Leoni

unread,
Apr 18, 2017, 10:49:52 AM4/18/17
to OMNeT++ Users
Hi everybody,
I was wondering if it exists a way to perform something similar to the processMessage() function by a cSimpleModule class. What I have is a module M1 that wraps another module M2, and input and output gates are connected as usual.
        in --> M2.in;
        out <-- M2.out;

My problem is that I would inspect the content of the messages and eventually drop them, and I would like to execute this code in the wrapper module M1.

Is there a smart way to achieve this?

Thanks in advance.

Attila Török

unread,
Apr 21, 2017, 6:18:24 AM4/21/17
to OMNeT++ Users
Hi!

You could try creating a custom channel, and connect the submodules to the inner edge of M1 using it (so putting it on the connections in the snippet in you letter). In this channel you can inspect and collect statistics about the messages passing through it, and you can easily decide to drop them as you wish. You can even call into the code of the M1 module as needed.

Attila

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

areej alabbas

unread,
Nov 9, 2019, 6:25:56 AM11/9/19
to OMNeT++ Users
I would like to do something similar, I am trying to add a queueing model (M/D/1) on the processMessage  but the problem in queueing model I have to send selfmessage which is not supported by cchaneel class? so how can I make processMessage work as cSimpleModule class ( which allows sending selfmessage to it self? 


On Friday, April 21, 2017 at 11:18:24 AM UTC+1, Attila Török wrote:
Hi!

You could try creating a custom channel, and connect the submodules to the inner edge of M1 using it (so putting it on the connections in the snippet in you letter). In this channel you can inspect and collect statistics about the messages passing through it, and you can easily decide to drop them as you wish. You can even call into the code of the M1 module as needed.

Attila
2017-04-18 16:49 GMT+02:00 Alessandro Leoni <leoni.al...@gmail.com>:
Hi everybody,
I was wondering if it exists a way to perform something similar to the processMessage() function by a cSimpleModule class. What I have is a module M1 that wraps another module M2, and input and output gates are connected as usual.
        in --> M2.in;
        out <-- M2.out;

My problem is that I would inspect the content of the messages and eventually drop them, and I would like to execute this code in the wrapper module M1.

Is there a smart way to achieve this?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages