}
while (!_rtiFederate->getTimeConstrainedEnabled()) {
- _rtiFederate->processMessage();
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessage()) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
}
return true;
}
while (!_rtiFederate->getTimeRegulationEnabled()) {
- _rtiFederate->processMessage();
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessage()) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
}
return true;
SG_LOG(SG_NETWORK, SG_WARN, "HLA: Accessing unconnected federate!");
return false;
}
- return _rtiFederate->processMessage();
+
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessage()) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
+ return true;
}
bool
SG_LOG(SG_NETWORK, SG_WARN, "HLA: Accessing unconnected federate!");
return false;
}
- return _rtiFederate->processMessages(timeout.toSecs(), 0);
+
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessages(timeout.toSecs(), 0)) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
+ return true;
}
bool
}
while (_rtiFederate->getTimeAdvancePending()) {
- _rtiFederate->processMessage();
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessage()) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
}
if (_timeConstrainedByLocalClock) {
double rest = (systemTime - SGTimeStamp::now()).toSecs();
if (rest < 0)
break;
- _rtiFederate->processMessages(rest, rest);
+ if (RTIFederate::ProcessMessageFatal == _rtiFederate->processMessages(rest, rest)) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
}
}
// Now flush just what is left
- while (_rtiFederate->processMessages(0, 0));
+ while (true) {
+ RTIFederate::ProcessMessageResult result = _rtiFederate->processMessages(0, 0);
+ if (RTIFederate::ProcessMessageLast == result)
+ break;
+ if (RTIFederate::ProcessMessageFatal == result) {
+ SG_LOG(SG_NETWORK, SG_WARN, "HLA: Fatal error on processing messages!");
+ return false;
+ }
+ }
return true;
}