Duration_t timeout;
timeout.sec = 0;
timeout.nanosec = 1000000;
ConditionSeq active_conditions = new ConditionSeq();
bool is_cond1_triggered = false;
bool is_cond2_triggered = false;
try {
waitset.wait(active_conditions, timeout);
for (int i = 0; i < active_conditions.length; ++i) {
if (active_conditions.get_at(i) == cond1) {
Console.WriteLine("Cond1 was triggered!");
is_cond1_triggered = true;
}
if (active_conditions.get_at(i) == cond2) {
Console.WriteLine("Cond2 was triggered!");
is_cond2_triggered = true;
}
}
if (is_cond1_triggered) {
}
if (is_cond2_triggered) {
}
} catch (DDS.Retcode_Timeout) {
Console.WriteLine(
"Wait timed out!! None of the conditions was triggered.");
} catch (DDS.Exception) {
throw;
}