InputPort: OldData and NoData behaviour

Dear all, I'm interested in NoData / OldData return value of method InputPort::read(). I noticed that after starting my component, if I write data once on a connection, I'll never get NoData as a return value even if actually I'm writing nothing. All I can get is OldData.

I'd like to know if my 'publisher' component is currently writing something or if not. In fact, because my 'listener' component is actually polling connection at a higher frequency with respect to 'publisher' component's frequency, I cannot use OldData in order to do this (I expect a lot of OldData).

There is a way to do this? I've looked at InputPort::clear() but his behaviour is a little bit obscure to me...

Thank you in advance. Best regards,

Federico