![]() |
MAK RTIspy API Documentation for HLA 1516
|
Some applications want to avoid excessive polling of the RTI - calling tick() repeatedly even when no data is available to be read.
The MAK RTI lets you find out when data is available to be read in an event-based fashion.
Federates can call the DtReadFileDescriptor() member function, declared in makRti.h, to obtain a file descriptor on which data will be present whenever there is incoming data waiting to be processed by the RTI:
A separate file descriptor is used to signal the presence of reliable versus best effort data. The file descriptor can be used in calls like select() to avoid unnecessary polling.
On Windows, this function works only if you are not using asynchronous mode. If you are using asynchronous mode, DtReadFileDescriptor() returns -1, and you must use an alternate method to avoid polling. The DtReadFileEvent() member function (also declared in makRti.h), returns a WIN32 event handle that signals when data is available to be read:
This function can be used in calls such as WaitForSingleObject to avoid polling.
[<< Responding to Dropped Federates ] [Home] [rtiexec Plug-ins >>]