|
From: Alex D. <ale...@gm...> - 2014-11-28 14:49:28
|
I tried the loop , calling "take_next_sample" until the
no_data_available, but still have no success.
One other thing I tried was the example from the
DataReaderListener.cpp on the test/LargeSample example from OpenDDS
distribution tests :
Messenger::MessageSeq messages;
DDS::SampleInfoSeq info;
DDS::ReturnCode_t error = message_dr->take(messages,
info,
DDS::LENGTH_UNLIMITED,
DDS::ANY_SAMPLE_STATE,
DDS::ANY_VIEW_STATE,
DDS::ANY_INSTANCE_STATE);
if (error == DDS::RETCODE_OK) {
for (unsigned int i = 0; i < messages.length(); ++i) {
//code omitted
}
But with no success still.
On Thu, Nov 27, 2014 at 6:33 PM, Massimo Pichini
<mas...@gm...> wrote:
> Just loop calling take_next_sample until you get a no_data_available result.
> Otherwise you should use the data reader take operation passing a sequence
> of SampleInfo and the appropriate view status.
>
> Massimo
>
> 2014-11-27 15:57 GMT+01:00 Alex Douckas <ale...@gm...>:
>>
>> Hello again,
>>
>> I forgot to mention that the Publisher application has a WaitSet and
>> does not start transmission until a Subscriber is present, so a) is
>> not the case.
>>
>> For b) , I think it's not the case either, since the default values of
>> durability_service max_samples and max_instances are LENGTH_UNLIMITED.
>>
>> As far as c) is concerned, what is the correct loop condition to read
>> the data samples that are queued in the data reader cache ?
>>
>> Kind Regards,
>> Alex
>>
>> On Thu, Nov 27, 2014 at 4:20 PM, Massimo Pichini
>> <mas...@gm...> wrote:
>> > Hi there,
>> >
>> > I see a some potentials causes of your problem:
>> >
>> > a) DataWriter start publication before the association with the
>> > DataReader
>> > is setup. In this case all samples published before the association is
>> > established are lost, unless you enable support for late subscribers in
>> > the
>> > data writer setting the Durability QOS to at least
>> > TRANSIENT_LOCAL_DURABILITY;
>> > b) the Durability Service QoS max_xxx enforce a lower level of max
>> > samples/instances that can be kept in the data writer cache
>> > c) the on_data_available callback should invoke the take_next_sample in
>> > a
>> > loop otherwise samples queued in the data reader cache can remain
>> > unprocessed
>> >
>> > best regards
>> > Massimo
>> >
>> >
>> >
>> > 2014-11-27 10:02 GMT+01:00 Alex Douckas <ale...@gm...>:
>> >>
>> >> Hello,
>> >>
>> >> I have created a publisher application and a subscriber one ( both in
>> >> C++ ) with the following QoS policies on both Topic and DataWriter (
>> >> and DataReader respectively ) :
>> >>
>> >> DDS::TopicQos default_topic_qos;
>> >> participant->get_default_topic_qos(default_topic_qos);
>> >> default_topic_qos.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
>> >> default_topic_qos.history.depth = 140000;
>> >> default_topic_qos.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
>> >>
>> >> DDS::DataWriterQos dw_default_qos;
>> >> pub->get_default_datawriter_qos (dw_default_qos);
>> >> dw_default_qos.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
>> >> dw_default_qos.history.depth = 140000;
>> >> dw_default_qos.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
>> >>
>> >> Now, the publisher is sending about 3000 data samples, each one every
>> >> 100 miliseconds. So to test the history and reliability policies, I
>> >> set a delay on the subscriber ( with usleep) of 500 miliseconds on the
>> >> "on_data_available" class like this :
>> >>
>> >> DDS::SampleInfo si ;
>> >> DDS::ReturnCode_t status = measurement_dr->take_next_sample(data,
>> >> si) ;
>> >>
>> >> if (status == DDS::RETCODE_OK) {
>> >> //omitted Code that manipulates the data sample
>> >>
>> >> usleep (500000);
>> >>
>> >> } else if (status == DDS::RETCODE_NO_DATA) {
>> >> cerr << "INFO: reading complete after " << count << " samples."
>> >> <<
>> >> endl;
>> >> break;
>> >> }
>> >>
>> >> The problem is that after about 1000 received samples, the subscriber
>> >> somehow stops receiving the rest samples. Since the depth of History
>> >> is bigger than the samples, the subscriber should receive everything.
>> >> The same thing happens even if I use KEEP_ALL_HISTORY instead of
>> >> KEEP_LAST. Do you have any idea about this issue ? Am I using the
>> >> policies wrong ?
>> >>
>> >> Thanks,
>> >> Alex
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> >> from Actuate! Instantly Supercharge Your Business Reports and
>> >> Dashboards
>> >> with Interactivity, Sharing, Native Excel Exports, App Integration &
>> >> more
>> >> Get technology previously reserved for billion-dollar corporations,
>> >> FREE
>> >>
>> >>
>> >> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> >> _______________________________________________
>> >> opendds-main mailing list
>> >> ope...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/opendds-main
>> >
>> >
>> >
>> >
>> > --
>> > Massimo
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> > with Interactivity, Sharing, Native Excel Exports, App Integration &
>> > more
>> > Get technology previously reserved for billion-dollar corporations, FREE
>> >
>> > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> > _______________________________________________
>> > opendds-main mailing list
>> > ope...@li...
>> > https://lists.sourceforge.net/lists/listinfo/opendds-main
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> _______________________________________________
>> opendds-main mailing list
>> ope...@li...
>> https://lists.sourceforge.net/lists/listinfo/opendds-main
>
>
>
>
> --
> Massimo
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> opendds-main mailing list
> ope...@li...
> https://lists.sourceforge.net/lists/listinfo/opendds-main
>
|