I have created a sample rti dds java project. However the subscriber is not recieving data if the writer.write() is not within a loop with a thread sleep.
Subscriber doesn't get the data
instance.ID = 10;
instance.value = 3.14;
writer.write(instance, instance_handle);
Subscriber get's the data
for (int count = 0;
(sampleCount == 0) || (count < sampleCount);
++count) {
System.out.println("Writing myExample, count " + count);
/* Modify the instance to be written here */
/* Write data */
instance.ID = 10;
instance.value = 3.14;
writer.write(instance, instance_handle);
try {
Thread.sleep(sendPeriodMillis);
} catch (InterruptedException ix) {
System.err.println("INTERRUPTED");
break;
}
}