| 46 | int test_failed = 0; |
| 47 | |
| 48 | int 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 |
| 72 | int parse_args(int argc, ACE_TCHAR *argv[]) |