Listeners in Request-Reply

3 posts / 0 new
Last post
njc
Offline
Last seen: 10 years 7 months ago
Joined: 08/09/2012
Posts: 17
Listeners in Request-Reply

Is there anyway to remove and add a new listener to after the connext::Replier has been created? I pass in the listener via connext::ReplierParams when creating a replier, but after that is there any way to remove the listener and set a new one?


Thanks

asanchez's picture
Offline
Last seen: 4 years 5 months ago
Joined: 11/16/2011
Posts: 50

Hello njc,

The connext::Requester as well as the connext::Replier use DDS DataWriters and DataReaders for both writing and reading requests and replies, respectively. This means that you can retrieve them and call any operation on them as you need.


For this particular example, the Replier's DataReader can be accessed by calling FooBarReplier_get_request_datareader. Then regular reader operations can be called on it, so for setting a listener, you can just call DDS_DataReader_set_listener. This operation will remove the current DataReader's listener if a NULL listener is passed as a parameter.


Antonio

njc
Offline
Last seen: 10 years 7 months ago
Joined: 08/09/2012
Posts: 17

Ah, makes sense. Thanks!