Hi,
First of all, thanks for the reply.
Obviously I am doing womething worng with the signaling because I
cannot get the signal delivered to the module that has subscribed to
it.
I have 2 modules, MasterInterface and Source. The Source module is a
slightly modification of the Source module from the OMNeT++ examples.
The init functions of these two modules look like this:
void MasterInterface::initialize(int stage)
{
switch(stage){
case 0:
iocBusySignal = registerSignal("IOCmoduleIsBusy");
break;
case 1:
currentlyStored = 0;
break;
}
}
void Source::initialize(int stage)
{
switch(stage){
case 0:
startTime = par("startTime");
stopTime = par("stopTime");
numJobs = par("numJobs");
break;
case 1:
iocBusySignal = registerSignal("IOCmoduleIsBusy");
subscribe(iocBusySignal, this);
// schedule the first message timer for start time
scheduleAt(startTime, new cMessage("newJobTimer"));
break;
}
}
And the receiveSignal() function of the Source module looks like this,
it only prints out a dummy message, so just to make sure that the
function is called:
void Source::receiveSignal(cComponent *source, simsignal_t signalID,
long l){
// if received the signal, do not allow further messages to be
scheduled for "creation"
EV<< "###########################################" << endl;
EV << this->getFullName() << " at " << this->getParentModule()-
>getFullName() << " received SEND BLOCKED Signal from IOC!" << endl;
EV<< "###########################################" << endl;
}
However this message does not get shown in the Tkenv output. So I
suppose somehow the signal I registered first from the MasterInterface
Module (which is actually supposed to emit it in various cases during
the simulation), and then subscribed to from the Source Module, does
not get sent to the Source module and the receiveFunction does not get
called.
I have subclassed the Source from cListener like this:
class QUEUEING_API Source : public SourceBase, protected cListener
{
....
Is this wrong? if not do you have any idea what am I doing wrong?
Because I don't, and I spend almost a week now trying to get a simple
signaling between two modules working. I suppose signaling is an easy
feature, and as such I just wanted to use it to generate some
backpressure information between the two modules. If signaling is not
supposed to be used for such purpose, can you please point me to
another approach for generating back pressure between two
communicating modules?
Best regards,
Konstantin