MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / wait_for_data

Function wait_for_data

tests/DCPS/ViewState/main.cpp:48–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46int test_failed = 0;
47
48int wait_for_data (::DDS::Subscriber_ptr sub,
49 int timeout_sec)
50{
51 const int factor = 10;
52 ACE_Time_Value small_time(0,1000000/factor);
53 int timeout_loops = timeout_sec * factor;
54
55 ::DDS::DataReaderSeq_var discard = new ::DDS::DataReaderSeq(10);
56 while (timeout_loops-- > 0)
57 {
58 sub->get_datareaders (
59 discard.inout (),
60 ::DDS::NOT_READ_SAMPLE_STATE,
61 ::DDS::ANY_VIEW_STATE,
62 ::DDS::ANY_INSTANCE_STATE );
63 if (discard->length () > 0)
64 return 1;
65
66 ACE_OS::sleep (small_time);
67 }
68 return 0;
69}
70
71/// parse the command line arguments
72int parse_args(int argc, ACE_TCHAR *argv[])

Callers 3

ACE_TMAINFunction · 0.70
readFunction · 0.50
readFunction · 0.50

Calls 3

get_datareadersMethod · 0.45
inoutMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected