Example of setting up RTI DataReader to read from a UDP port

3 posts / 0 new
Last post
Offline
Last seen: 5 years 8 months ago
Joined: 09/06/2018
Posts: 22
Example of setting up RTI DataReader to read from a UDP port

Hi,

We are using RTI DDS v5.3.1 on RHEL 7.5.  We are translating some old non-RTI code to RTI DDS.

We have some code that reads from a UDP port; The code contains a call to the POSIX function 'socket' where the IP address and port are specified.

I see how to specify the transport for UDP for the datareader by using DDS_DataReaderQos, but I don't see a way to specify the UDP port's IP address.

I looked in rti_workspace(and docs) but I didn't see any examples.  Can someone point me to an example of this use case?

tia!

irwin's picture
Offline
Last seen: 4 years 5 months ago
Joined: 08/14/2010
Posts: 42

Normally, the Reader will use the default Udpv4 ports and IP address. The typical DDS use case is to change from the default port to some other port. The reason for that is to make RTIDDS create another read socket thread. But you can specify your own IP address as follows by assigning the string "udpv4://01.02.03.04" to the dataReader_qos.unicast.value[0].transports.

Offline
Last seen: 5 years 8 months ago
Joined: 09/06/2018
Posts: 22

I will give this a try!

Thx!