EventPort and component activities

Hi,

I am trying to use EventPort in some kind of reporting component. I have created a DataPort 'f' and added it on the reader part as an EventPort.

I have set the activity of the reader to NonPeriodic.

When I launch my soft with the deployer, it indicates:
Reader will be triggered when new data is available on f

However, nothing happens (I expected the updateHook function it be called).

I have started both Writer and Reader, and tried several configurations (BufferPort, PeriodicActivity, SequentialActivity...)

Need some help.

Thanks !

Charles.

EventPort triggering

In file DataFlowInterface.cpp, it seems that addEventPort does nothing more than addPort if I do not give a callback function... the doc (Component Builder, 3.8.1) gives an exemple with
this->ports()->addEventPort( &indatPort, "Event driven Input Data Port" );

Is there a mistake?

---
Charles.

EventPort triggering

Charles Lesire-Cabaniols wrote:

In file DataFlowInterface.cpp, it seems that addEventPort does nothing more than addPort if I do not give a callback function... the doc (Component Builder, 3.8.1) gives an exemple with
this->ports()->addEventPort( &indatPort, "Event driven Input Data Port" );

Is there a mistake?

---
Charles.

No. That code is correct. addEventPort() stores the port in a special list (eports), which is used when TaskContex::start() is called. The message that says the task will be triggered comes from the TaskContext's start() method (after the callback is added). The only bug in start() is that the returned Handle object is not checked, so that if the connection failed for some reason, that should be logged instead of the current message. For the rest, the code really looks ok (but clearly isn't).

It looks like you're doing nothing wrong. There should have been a unit test for this. I'll add it and we'll see how to reproduce it.

Peter