MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtAsyncConnectionMgr Class Reference

the Asynchronous Connection Mgr adds asynchronous I/O to the connectionMgr class. More...

+ Inheritance diagram for DtAsyncConnectionMgr:
+ Collaboration diagram for DtAsyncConnectionMgr:

Public Member Functions

virtual ~DtAsyncConnectionMgr ()
 
virtual int init (DtRIDParameters *params)
 Initialize the RTI's exercise connections Users who wish to override the MAK RTI's network connections should override this function After the network connections are set it up creates a thread to monitor the sockets. More...
 
virtual void setFederateMgr (DtFederateMgr *fedMgrPtr)
 Set the federate manager. More...
 
virtual void shutdown ()
 Request shutdown of communication activities. More...
 
virtual bool isAsynchronous ()
 return if in asynchronous mode More...
 
virtual void disconnectFederation ()
 The LRC disassociates its connections from the federation. More...
 
virtual void connectFederation (DtLogicalTimeFactory *logicalTimeFactoryPtr, MAKRti::DtString fedExName, DtFederateHandle fedHandle, int fedExHandle)
 The LRC associates its federation information with its network connections. More...
 
virtual int send (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send a message. More...
 
virtual int sendAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send a message and delete the message after it has been sent Retraction record of timestamped messages must made here. More...
 
virtual bool tick ()
 Process the connections for synchronous IO or callbacks. More...
 
virtual bool processConnections ()
 Check all the connections and process any incoming messages Return boolean: message was received? (i.e. More...
 
virtual DtRtiMsggetMessage ()
 Get a message if one exists Message must be destroyed by caller. More...
 
virtual DtNetReadStatus handleMsg (DtRtiMsg &msg)
 Handle this message by either processing it or queuing it if save pending. More...
 
virtual bool flush ()
 Does nothing in Async. More...
 
virtual void receiveThread ()
 worker thread (called by run) More...
 
virtual void sendThread ()
 
virtual bool wait (MAKRti::DtTime periodInSeconds, bool unlockWhileWaiting=false)
 Wait for data to be ready or the given period of time to expire Return boolean: data is ready for reading? More...
 
virtual int readFileDescriptor (DtRtiApiTransportationType transport)
 Returns a file descriptor on which data will be present for the given transport type whenever there is incoming data waiting to be read. More...
 
virtual int waitEvent ()
 return the waiting handle More...
 
virtual void signalReceiveEvent ()
 Signal the receive event Used by IO thread to signal federate thread. More...
 
virtual void clearReceiveEvent ()
 Clear receive event Used by federate thread to clear signal. More...
 
virtual void signalSendEvent ()
 Signal the send event Used by federate thread to signal IO thread. More...
 
virtual void clearSendEvent ()
 Clear send event Used by IO thread to clear signal. More...
 
virtual void yield ()
 Yield processing to allow more data to arrive. More...
 
virtual bool processConnectionsInCallback ()
 Process the connections while in a callback to get a message (e.g., processing MOM resign) Return OK status of connections. More...
 
- Public Member Functions inherited from DtConnectionMgr
virtual ~DtConnectionMgr ()
 Destructor. More...
 
virtual void initParams (DtRIDParameters *params)
 Initialize the parameters used by the connection manager. More...
 
virtual void enableSmartForwarding (bool enableSmartForwarding, bool enableInternalMessageSmartForwarding, int maxNumFederates)
 Enables or disables smart forwarding. More...
 
virtual DtRIDParametersparams ()
 Get a pointer to the RID parameters. More...
 
virtual bool isShuttingDown ()
 Shutdown acknowledged. More...
 
virtual void setFederateAmbassador (RTI_API::FederateAmbassador *fedAmb)
 Set the federate ambassador. More...
 
virtual
RTI_API::AuthorizationResult::Code 
authorizationResult () const
 Connection is authorized? More...
 
virtual const MAKRti::DtString & authorizationMessage () const
 Authorization message. More...
 
virtual bool authorizationIsEnabled () const
 Return true if authorization is enabled. More...
 
virtual bool isAuthorized () const
 Return true if authorized. More...
 
virtual int sendStamped (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 Send a message stamped with fedEx name and federate ID Retraction record of timestamped messages made here. More...
 
virtual int sendStampedAnonymous (const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send a message stamped with fedEx name, but not federate ID Does not make retraction record of sent messages. More...
 
virtual int sendDirectedAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, DtFederateHandle fedHandle, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 Send and delete a message stamped with federate ID These messages are sent to a specific entity by using internal smart forwarding if enabled. More...
 
virtual int sendStampedAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 Send and delete a message stamped with fedEx name and federate ID Retraction record of timestamped messages made here. More...
 
virtual void sendLoopback (DtRtiMsg *msg)
 Send a message to be processed by this federate. More...
 
virtual bool drainBacklog (MAKRti::DtTime timeout=0.0)
 Attempts to flush backlogged messages repeatedly until either all messages are sent or the timeout expires. More...
 
virtual void activateTransmitDelay ()
 Activate a delay timer (based on RID) used by managers to control transmission of internal state Expired delays disable activation for current tick. More...
 
virtual bool delayTransmit () const
 Return true if retransmission of internal state should be delayed. More...
 
virtual void testTransmitDelay ()
 Test if retransmit delay time has expired. More...
 
virtual void activateAutoProvideDelay ()
 Activate a delay timer (based on RID) used by managers to control timing for autoprovide callbacks Expired delays disable activation for current tick. More...
 
virtual bool delayAutoProvide () const
 Return true if autoprovides should be delayed. More...
 
bool allProvideUpdateRequestsDelayed () const
 Return true if all provide update calls should be delayed (not just auto provide). More...
 
virtual void testAutoProvideDelay ()
 Test if autoprovide delay time has expired. More...
 
virtual void processThrottledMessages ()
 Process messages in throttle queue that are being sent at specified rate. More...
 
virtual void flushThrottledMessages ()
 Flush messages in throttle queue. More...
 
virtual unsigned long incrementServiceCallCount () const
 Increment a (mutable) counter to identify the service call being processed. More...
 
virtual unsigned long serviceCallCount () const
 Return service call counter. More...
 
virtual bool processConnection (DtRtiConnection *conn, MAKRti::DtTransportType trans)
 Read from the given connection and process the message (if received) Return boolean: message was received? (i.e. More...
 
virtual void updateBufferSizes ()
 Update Buffer sizes from Rid params object. More...
 
virtual DtNetReadStatus processMsg (const DtRtiMsg &msg)
 this function applies the callbacks to the message More...
 
virtual DtNetReadStatus momProcessMsg (const DtRtiMsg &msg)
 apply MOM callbacks to message More...
 
DtFederateMgrfedMgr ()
 The federate manager. More...
 
DtPartnerMgrpartnerMgr ()
 Partner manager. More...
 
virtual MAKRti::DtTransportType internalTransportType () const
 Returns the TransportType associated for the internal connection. More...
 
virtual bool setupSelectParams (DtSelectParam *params)
 adds Read File descriptors to a DtSelectParams Return boolean: file descriptor was added? In case no descriptors have been added, should sleep instead of select as there will be no input. More...
 
virtual bool hasTransport (MAKRti::DtTransportType trans)
 returns true if the specified transport type is available More...
 
virtual DtRtiMsgcreate (DtRtiMsgKind kind)
 Request the RTI message factory for a msg. More...
 
virtual void setMsgFactory (DtRtiMsgFactory *fact)
 Get/Set the message factory. More...
 
virtual DtRtiMsgFactorymsgFactory () const
 
virtual void forceDropMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Override listen count and force drop multicast address. More...
 
virtual void prepareToDisconnect ()
 Make preparations to disconnect. More...
 
virtual
RTI_API::FederateAmbassador * 
fedAmb () const
 Return pointer to Federate Ambassador. More...
 
virtual void addFedAmbWrapper (MAKRti::DtString const &name, DtFedAmbWrapper *fedAmb)
 Register a Federate Wrapper with the RTI A federate wrapper allows your plugin to monitor any RTI invoked services. More...
 
virtual bool addFedAmbWrapperAtFront (MAKRti::DtString const &name, DtFedAmbWrapper *fedAmb)
 When the fedAmb Wrapper is installed make certain that this particular wrapper is the first to process the msg. More...
 
virtual DtFedAmbWrapperremoveFedAmbWrapper (MAKRti::DtString const &name)
 Remove federate wrapper. More...
 
virtual unsigned long connectionId () const
 Return connection ID. More...
 
virtual DtFederateHandle fedHandle () const
 Return federate handle. More...
 
virtual unsigned long fedExHandle () const
 Return federation execution handle. More...
 
virtual const MAKRti::DtString & fedExName () const
 Return federation execution name. More...
 
virtual void setFederateHandle (DtFederateHandle handle)
 set federate handle ( this is used by restore and should not be called otherwise ) More...
 
virtual RTI_API::FederateHandle apiFederateHandle (DtFederateHandle handle) const
 Return the API federate handle encoded from the given internal handle. More...
 
virtual RTI_API::FederateHandle apiFederateHandle () const
 Return the API federate handle encoded from this federate's handle. More...
 
virtual DtLogicalTimeFactorylogicalTimeFactory (DtFederationHandle federationHandle=0) const
 Get the factory for the given federation that can create logical time/interval instances. More...
 
virtual void addLogicalTimeFactory (DtFederationHandle federationHandle, DtLogicalTimeFactory *timeFactory)
 Add the factory for the given federation that can create logical time/interval instances. More...
 
virtual void removeLogicalTimeFactory (DtFederationHandle federationHandle)
 Remove the factory for the given federation that can create logical time/interval instances. More...
 
virtual DtRtiMsgQueuemsgQueue ()
 Set/Get the time managed message queue. More...
 
virtual void setMsgQueue (DtRtiMsgQueue *msgQueuePtr)
 
virtual DtRetractInfoListretractList ()
 Set/Get the time managed retract list. More...
 
virtual void setRetractList (DtRetractInfoList *listPtr)
 
virtual bool saveInProgress () const
 Set/Get the flag indicating whether a save is in progress Unless a message is marked safe to process during a save a received message is queued for later processing. More...
 
virtual void setSaveInProgress (bool saveIsInProgress)
 
virtual bool restoreInProgress () const
 Set/Get the flag indicating whether a restore is in progress Unless a message is marked safe to process during a save a received message is queued for later processing. More...
 
virtual void setRestoreInProgress (bool saveIsInProgress)
 
virtual bool saveRestoreInProgress () const
 Return bool: Is save or restore in progress. More...
 
virtual void setMetadataControl (DtMetadataType type, bool onOff)
 Set/Get metadata control indicators. More...
 
virtual bool isMetadataEnabled (DtMetadataType type)
 
virtual void sendShutdownForwarderMsg ()
 Called by the rtiExec when it is exiting, only if it started this forwarder. More...
 
virtual unsigned long sequenceNumber () const
 Get the next sequence number. More...
 
virtual void incrementSequenceNumber ()
 Increment the sequence number. More...
 
virtual bool connectionLost ()
 Indicates that the connection of the RTI has been lost. More...
 
virtual void resetConnectionLost ()
 Status Reset For Connection Lost Flag *Should be called after the connection loss has been handled. More...
 
virtual int sendDirectedStampedAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, DtFederateHandle fedHandle, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 
virtual int sendDirectedStampedAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, DtBitMask *sendMask, const MAKRti::DtInetAddr &=MAKRti::DtInetAddr::inaddrAny())
 
virtual int sendStampedAnonymousAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 
virtual int sendDirectedStampedAnonymousAndDelete (DtRtiMsg *msg, MAKRti::DtTransportType transport, DtFederateHandle fedHandle, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 
virtual void setProcessingTick (bool processingTick)
 Set/Get tick processing state. More...
 
virtual bool processingTick () const
 Set/Get tick processing state. More...
 
virtual void setEvokingCallbacks (bool evokingCbs)
 Set/Get the evoke callbacks state. More...
 
virtual bool evokingCallbacks () const
 Set/Get the evoke callbacks state. More...
 
virtual void addPendingMsg (DtRtiMsg *msg)
 Add/get/process a pending message Messages will be processed during the next tick. More...
 
virtual bool processPendingMsg ()
 Add/get/process a pending message Messages will be processed during the next tick. More...
 
virtual DtRtiMsgnextPendingMsg ()
 Add/get/process a pending message Messages will be processed during the next tick. More...
 
virtual void emptyPendingMsgList ()
 Add/get/process a pending message Messages will be processed during the next tick. More...
 
bool isPendingMsgQueueEmpty ()
 Add/get/process a pending message Messages will be processed during the next tick. More...
 
virtual void addMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections. More...
 
virtual void removeMsgCallback (DtRtiMsgKind msgKind, DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections. More...
 
virtual void addWildcardMsgCallback (DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections. More...
 
virtual void removeWildcardMsgCallback (DtRtiMsgCbMgr::DtCallbackFcn fcn, void *usr, bool isMomCallback=false)
 Message Callbacks These callback functions operate on all of the connections. More...
 
virtual DtRtiConnectionreliableConn () const
 Returns the connection created by createTcpConn(). More...
 
virtual DtRtiConnectionbestEffortConn () const
 Returns the connection created by createBestEffortConn(). More...
 
virtual void listenToMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement. More...
 
virtual void dropMulticastGroup (const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
 Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement. More...
 
virtual bool lockServiceCall ()
 Called by asynchronous processing thread to gain mutually exclusive access to RTI managers. More...
 
virtual void unlockServiceCall ()
 Called by asychronous processing thread to release mutually exclusive access to RTI managers. More...
 
virtual bool serviceCallLocked ()
 Called by RTI Ambassador services query if mutex was set using lockServiceCall() More...
 
virtual bool enterServiceCall ()
 Called by RTI Ambassador services to gain mutually exclusive access to RTI managers. More...
 
virtual void exitServiceCall ()
 Called by RTI Ambassador services to release mutually exclusive access to RTI managers. More...
 
virtual bool inServiceCall ()
 Called by RTI Ambassador services query if mutex was set using enterServiceCall() More...
 

Static Public Member Functions

static DtConnectionMgrcreate (DtRIDParameters *p, bool isFederate=false, std::shared_ptr< DtRtiAssistantLrcClient > assistantClient=std::shared_ptr< DtRtiAssistantLrcClient >())
 Creator function. More...
 
static void * runReceive (void *usr)
 thread start calls worker thread More...
 
static void * runSend (void *usr)
 
- Static Public Member Functions inherited from DtConnectionMgr
static DtConnectionMgrcreate (DtRIDParameters *p, bool isFederate=false, std::shared_ptr< DtRtiAssistantLrcClient > assistantClient=std::shared_ptr< DtRtiAssistantLrcClient >())
 A Connection Manager instance is created, initialized and its pointer is returned. More...
 
static void setCreatorFunction (DtConnectionMgrCreator fn)
 Register a creator function. More...
 
static void setInternalCreatorFunction (DtConnectionMgrCreator fn)
 Register alternate internal creators. More...
 

Protected Member Functions

 DtAsyncConnectionMgr (DtRIDParameters *params, bool isFederate=false, std::shared_ptr< DtRtiAssistantLrcClient > assistantClient=std::shared_ptr< DtRtiAssistantLrcClient >())
 
virtual bool repairFederationConnection () override
 Attempt to re-establish a broken connection to the federation Returns true if successful. More...
 
virtual bool waitForConnectionRepair () const
 Threads not repairing a broken connection wait for it to be repaired. More...
 
virtual bool doReceiveProcessing (unsigned long timeout)
 Do the receive processing of the connections. More...
 
virtual void doDisconnectFederation ()
 Perform actual disconnect. More...
 
virtual bool doWait (MAKRti::DtTime period)
 Perform actual wait, called by wait function. More...
 
virtual void processCallbackMsg (const DtFedAmbCallbackMsg &callbackMsg)
 Message callback. More...
 
virtual bool sendPackets ()
 Send buffered packets. More...
 
virtual DtNetReadStatus receivePacket (DtRtiConnection *conn, MAKRti::DtTransportType transportType, unsigned int &receivedPacketCount)
 Process a packet from the given connection. More...
 
virtual bool receivePackets ()
 Process connections and either place packets in receive queue or process messages directly if asynchronous callbacks are enabled. More...
 
virtual void queueMsg (DtRtiMsg *msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
 method uses a mutex to lock the send queue while adding a a packet to the queue More...
 
virtual DtNetReadStatus processMsgQueueCallbacks (DtRtiMsg &msg, unsigned int &receivedPacketCount)
 Process message but queue any resulting federate ambassador callbacks. More...
 
virtual void processPendingMsgQueueCallbacks ()
 Process a pending message but queue any resulting federate ambassador callbacks. More...
 
virtual void processPendingMsgMakeCallbacks ()
 Process a pending message and make any resulting federate ambassador callbacks. More...
 
virtual void setMessageTracking (DtRtiMsg &msg)
 Set the appropriate tracking values in the message. More...
 
virtual void destroyPackets ()
 Destroy any packets in the send and receive buffers and queues. More...
 
virtual void destroyRelConn ()
 Destroy reliable connection. More...
 
virtual void destroyAncillaryRelConn (DtRtiConnection *conn)
 Destroy the given ancillary reliable connection. More...
 
virtual void destroyAncillaryRelConns ()
 Destroy ancillary reliable connections. More...
 
virtual void startAsynchronousReceiveProcessing ()
 Start asynchronous processing. More...
 
virtual void startAsynchronousSendProcessing ()
 
virtual void stopAsynchronousReceiveProcessing ()
 Stop asynchronous processing. More...
 
virtual void stopAsynchronousSendProcessing ()
 
DtQueuePacketgetPacket ()
 Get a packet off of receive buffer Receive buffer is refreshed if empty. More...
 
virtual bool createBestEffortConn ()
 Create best effort connection; Returns true if successful Could be that it already exist in which case it is still used. More...
 
virtual bool queueReceivePacket (DtRtiMsg *rtiMessage, MAKRti::DtTransportType transportType, bool &overflowWarning)
 Put message on receive queue. More...
 
virtual void testIoIndicator (const char *label, unsigned int queueLevel, unsigned int &lowWaterLine, unsigned int &highWaterLine, bool &overflowWarning)
 Test if the number of messages in an IO queue has exceeded the diagnostic indicator level. More...
 
- Protected Member Functions inherited from DtConnectionMgr
 DtConnectionMgr (DtRIDParameters *params, bool isFederate=false, std::shared_ptr< DtRtiAssistantLrcClient > assistantClient=std::shared_ptr< DtRtiAssistantLrcClient >())
 Constructor is performed through create. More...
 
virtual int initConnections ()
 Initialize the RTI's exercise connections Users who wish to override the MAK RTI's network connections should override this function. More...
 
virtual void destroyBestEffortConn ()
 Destroy best effort connection. More...
 
virtual bool createRelConn ()
 Create reliable connection; Returns true if successful. More...
 
virtual unsigned int createAncillaryRelConns ()
 Create ancillary reliable connections; Returns count of successful connections. More...
 
virtual unsigned int ancillaryReliableConnsCount () const
 Report number of ancillary reliable connections successfully established. More...
 
virtual bool checkRelConn ()
 Check the reliable connection status. Attempt to reconnect if connection has been lost. More...
 
virtual bool doConnectionRepair ()
 Do the connection repair. More...
 
virtual void processReadResult (int readError)
 Process read result to print error diagnostics for example. More...
 
virtual int sendStampedUtilityFunction (DtRtiMsg *msg, MAKRti::DtTransportType transport, bool performDelete, bool isAnonymous, const MAKRti::DtInetAddr &addr)
 Called by sendStamped, sendStampedAndDelete, sendAnonymousStamped, etc. More...
 
virtual void handleConnectMessage (const DtConnectMsg *message)
 Handle the connect message from the forwarder. More...
 
virtual void handleAuthorizationMessage (const DtAuthorizationResultMsg *resultMessage)
 Handle the authorization result message from the forwarder. More...
 

Static Protected Member Functions

static void processCallbackMsg (const DtFedAmbCallbackMsg &callbackMsg, void *usr)
 Message callback. More...
 

Protected Attributes

bool myTimeToQuitSending
 
bool myTimeToQuitReceiving
 
bool mySendThreadActivated
 
bool myReceiveThreadActivated
 
bool myAsynchronous
 
bool myAsynchronousCallbacks
 
bool myAsynchronousProcessMsg
 
bool myReserved
 
bool myMoreToFlush
 
bool myDoDisconnect
 
bool myNonReflectedList [DtInvalidMsgKind+1]
 
int myInPostTick
 
DtSelectParamWithWrite myWaitEventsParams
 
pthread_t myReceiveThreadHandle
 
pthread_t mySendThreadHandle
 
int mySendEvent [2]
 
int myRecvEvent [2]
 
DtMutex * myRepairMutex
 Mutex to synchronize access to connection repair lock. More...
 
bool myConnectionIsUnderRepair
 Indicates that connection is under repair (used to coordinate repair with asynchronous processing) More...
 
bool myReadyToRepair
 Indicates that connection is ready to repair (used to coordinate repair with asynchronous processing)) More...
 
float myIoPeriod
 
float myTickWaitPeriod
 
unsigned int myMaxQueue
 
unsigned int myMaxCount
 
unsigned int mySendPacketCount
 Number of packets until time to yield (== max count) More...
 
unsigned int myReadPacketCount
 
DtAsycQueueTypemySendQueue
 Exchange queues between federate and IO threads these lists are used in asynchronous mode. More...
 
DtAsycQueueTypemyReceiveQueue
 
DtCallbackQueue * myCallbackQueue
 A federate ambassador wrapper that queues up federate ambassador calls. More...
 
DtThreadSafe< bool > myAsynchronousConnectionIsOk
 
unsigned int myNextReliableConnToRead
 Mechanism to track which reliable connection to fetch packets from when multiple ancillary reliable connections exist. More...
 
unsigned int myIoQueueIndicator
 These are pointers to the locations in the WaitEvent list they need to be dynamic in case one of them doesn't exist. More...
 
unsigned int myReceiveQueueLowWaterLine
 
unsigned int myReceiveQueueHighWaterLine
 
bool myReceiveOverflowWarning
 
unsigned int mySendQueueLowWaterLine
 
unsigned int mySendQueueHighWaterLine
 
bool mySendOverflowWarning
 
bool myShouldWaitOnCurrentBundle
 This determines whether the send thread should sleep after it attempts to send all packets, but there is still more to send due to bundling or socket send failures. More...
 
char myRecvEventBuffer [100]
 
char mySendEventBuffer [100]
 
- Protected Attributes inherited from DtConnectionMgr
DtRtiMsgFactorymyMsgFactory
 The message factory. More...
 
DtRtiConnectionmyBestEffortConn
 The best effort connection. More...
 
DtRtiConnectionmyPrimaryReliableConn
 The primary reliable connection. More...
 
DtRtiConnectionList myReliableConns
 
DtRIDParametersmyParams
 The RTI initialization parameters. More...
 
DtFederateMgrmyFedMgr
 The federate manager. More...
 
std::map< MAKRti::DtInetAddr,
DtMulticastEntry * > 
myMulticastGroups
 LRC listening to these multicast groups. More...
 
DtFedAmbWrapperChain myFedAmbChain
 Chain of Federate Ambassador Wrappers. More...
 
DtDfltMsgFactory myDfltMsgFactory
 Default message factory. More...
 
DtRtiMsgCbMgr myMsgCbMgr
 Message callback manager. More...
 
DtRtiMsgCbMgr myMomMsgCbMgr
 MOM message callback manager. More...
 
MAKRti::DtTransportType myInternalTransportType
 Transport type used for internal messages. More...
 
bool myAddTransportTypeMetadata
 Metadata control indicators. More...
 
bool myAddMcastMetadata
 
std::map< DtFederationHandle,
DtLogicalTimeFactory * > 
myLogicalTimeFactories
 Factories for creating logical time instances. More...
 
DtRtiMsgQueuemyMsgQueue
 Message queue. More...
 
DtRetractInfoListmyRetractList
 Message retractions. More...
 
DtMessageQueueType myPendingMessages
 Pending messages. More...
 
bool myConnectionLost
 Connection Lost. More...
 
bool mySaveInProgress
 Save status. More...
 
bool myRestoreInProgress
 Restore status. More...
 
bool myAuthorizationIsEnabled
 Is authorization enabled. More...
 
RTI_API::AuthorizationResult::Code myAuthorizationResult
 
MAKRti::DtString myAuthorizationMessage
 Authorization message (mainly in case of failed authorization) More...
 
bool myDisconnectPending
 Disconnect from federation is pending. More...
 
unsigned long myConnectionId
 "unique" identifier for this connMgr (if there is a good source of unique ids) More...
 
MAKRti::DtString myFedExName
 Federation execution name. More...
 
DtFederateHandle myFedExHandle
 Federation execution handle. More...
 
DtFederateHandle myFederateHandle
 Federate handle. More...
 
unsigned long myReceivedMsgCount
 Number of received messages. More...
 
unsigned long mySentMsgCount
 Number of sent messages. More...
 
MAKRti::DtList myWorkingMsgId
 Diagnostic message ID stack. More...
 
DtMessageThrottlemyMessageThrottle
 Message output throttle. More...
 
bool myAllProvideUpdateRequestsDelayed
 Extend auto provide delay to all attribute update requests. More...
 
DtMutex * myCallbackMutex
 Mutex to synchronize access to RTI and Federate Ambassadors. More...
 
unsigned int myLockService
 RTI is processing a message. More...
 
unsigned int myInService
 RTI is processing a service call. More...
 
MAKRti::DtClock myClock
 Clock for timing. More...
 
std::shared_ptr
< DtRtiAssistantLrcClient
myAssistantClient
 The assistant client. More...
 
bool myIsFederate
 Whether this manager is for a federate. More...
 
unsigned long myVersionConflictCount
 The count of message version conflicts. More...
 
MAKRti::DtTime myVersionConflictNoticationTimer
 
unsigned long mySizeMismatchCount
 The count of message size mismatches. More...
 
MAKRti::DtTime mySizeMismatchNoticationTimer
 
DtPartnerMgrmyPartnerMgr
 
unsigned long myServiceCallCount
 Service call counter - increment before processing each service call. More...
 
bool myProcessingTick
 Tick processing state. More...
 
bool myEvokingCallbacks
 Indicates if callbacks are being evoked. More...
 
bool myProcessingMessage
 Indicates if message is being processed. More...
 
bool myShutdown
 Shutdown requested. More...
 
bool mySendShuttingDown
 Shutdown acknowledged. More...
 
bool myReceiveShuttingDown
 Shutdown acknowledged. More...
 
unsigned long myTickCount
 
const DtRtiApiTransportationType myBestEffortTransportType
 
const DtRtiApiTransportationType myReliableTransportType
 

Additional Inherited Members

- Public Types inherited from DtConnectionMgr
typedef DtConnectionMgr *(* DtConnectionMgrCreator )(DtRIDParameters *p, bool isFederate, std::shared_ptr< DtRtiAssistantLrcClient > assistantClient)
 Connection Manager Creator. More...
 
- Protected Types inherited from DtConnectionMgr
typedef std::list
< DtRtiConnection * > 
DtRtiConnectionList
 List of all reliable connections (for forwarder load balancing) More...
 
- Static Protected Attributes inherited from DtConnectionMgr
static DtConnectionMgrCreator theCreator
 The plugin creator. More...
 
static DtConnectionMgrCreator theInternalCreator
 The internal creator. More...
 

Detailed Description

the Asynchronous Connection Mgr adds asynchronous I/O to the connectionMgr class.

A thread is created to manage the send and receive queues. It can operate in a synchronous mode if the myAsynchronous flag is set to false.

Constructor & Destructor Documentation

DtAsyncConnectionMgr::DtAsyncConnectionMgr ( DtRIDParameters params,
bool  isFederate = false,
std::shared_ptr< DtRtiAssistantLrcClient assistantClient = std::shared_ptr< DtRtiAssistantLrcClient >() 
)
protected
virtual DtAsyncConnectionMgr::~DtAsyncConnectionMgr ( )
virtual

Member Function Documentation

virtual void DtAsyncConnectionMgr::clearReceiveEvent ( )
virtual

Clear receive event Used by federate thread to clear signal.

virtual void DtAsyncConnectionMgr::clearSendEvent ( )
virtual

Clear send event Used by IO thread to clear signal.

virtual void DtAsyncConnectionMgr::connectFederation ( DtLogicalTimeFactory logicalTimeFactoryPtr,
MAKRti::DtString  fedExName,
DtFederateHandle  federateHandle,
int  fedExHandle 
)
virtual

The LRC associates its federation information with its network connections.

If the LRC is communicating with the rtiexec through a reliable connection, then the best effort connection is created here.

Reimplemented from DtConnectionMgr.

static DtConnectionMgr* DtAsyncConnectionMgr::create ( DtRIDParameters p,
bool  isFederate = false,
std::shared_ptr< DtRtiAssistantLrcClient assistantClient = std::shared_ptr< DtRtiAssistantLrcClient >() 
)
static

Creator function.

virtual bool DtAsyncConnectionMgr::createBestEffortConn ( )
protectedvirtual

Create best effort connection; Returns true if successful Could be that it already exist in which case it is still used.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::destroyAncillaryRelConn ( DtRtiConnection conn)
protectedvirtual

Destroy the given ancillary reliable connection.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::destroyAncillaryRelConns ( )
protectedvirtual

Destroy ancillary reliable connections.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::destroyPackets ( )
protectedvirtual

Destroy any packets in the send and receive buffers and queues.

The buffers and queues themselves are not destroyed

virtual void DtAsyncConnectionMgr::destroyRelConn ( )
protectedvirtual

Destroy reliable connection.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::disconnectFederation ( )
virtual

The LRC disassociates its connections from the federation.

If the LRC is communicating with the rtiexec through a reliable connection, then the best effort connection is destroyed here.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::doDisconnectFederation ( )
protectedvirtual

Perform actual disconnect.

virtual bool DtAsyncConnectionMgr::doReceiveProcessing ( unsigned long  timeout)
protectedvirtual

Do the receive processing of the connections.

Takes timeout in milliseconds. Return OK status of connections.

virtual bool DtAsyncConnectionMgr::doWait ( MAKRti::DtTime  period)
protectedvirtual

Perform actual wait, called by wait function.

Reimplemented from DtConnectionMgr.

virtual bool DtAsyncConnectionMgr::flush ( )
virtual

Does nothing in Async.

I/O mode In sync. I/O mode, Flush the send queues Send buffered messages. Returns indication of whether flush is complete or incomplete.

Reimplemented from DtConnectionMgr.

virtual DtRtiMsg* DtAsyncConnectionMgr::getMessage ( )
virtual

Get a message if one exists Message must be destroyed by caller.

Reimplemented from DtConnectionMgr.

Reimplemented in DtNetStatsAsyncConnMgr.

DtQueuePacket* DtAsyncConnectionMgr::getPacket ( )
inlineprotected

Get a packet off of receive buffer Receive buffer is refreshed if empty.

virtual DtNetReadStatus DtAsyncConnectionMgr::handleMsg ( DtRtiMsg msg)
virtual

Handle this message by either processing it or queuing it if save pending.

Reimplemented from DtConnectionMgr.

virtual int DtAsyncConnectionMgr::init ( DtRIDParameters params)
virtual

Initialize the RTI's exercise connections Users who wish to override the MAK RTI's network connections should override this function After the network connections are set it up creates a thread to monitor the sockets.

Reimplemented from DtConnectionMgr.

Reimplemented in DtRtiShmQNetMgr.

virtual bool DtAsyncConnectionMgr::isAsynchronous ( )
virtual

return if in asynchronous mode

virtual void DtAsyncConnectionMgr::processCallbackMsg ( const DtFedAmbCallbackMsg callbackMsg)
protectedvirtual

Message callback.

static void DtAsyncConnectionMgr::processCallbackMsg ( const DtFedAmbCallbackMsg callbackMsg,
void *  usr 
)
staticprotected

Message callback.

virtual bool DtAsyncConnectionMgr::processConnections ( )
virtual

Check all the connections and process any incoming messages Return boolean: message was received? (i.e.

could be more input). method uses a mutex to receive the send queue while adding a packet to the queue

Reimplemented from DtConnectionMgr.

virtual bool DtAsyncConnectionMgr::processConnectionsInCallback ( )
virtual

Process the connections while in a callback to get a message (e.g., processing MOM resign) Return OK status of connections.

Reimplemented from DtConnectionMgr.

virtual DtNetReadStatus DtAsyncConnectionMgr::processMsgQueueCallbacks ( DtRtiMsg msg,
unsigned int &  receivedPacketCount 
)
protectedvirtual

Process message but queue any resulting federate ambassador callbacks.

Packet count is incremented if messages placed on receive buffer. Return status of message processing.

virtual void DtAsyncConnectionMgr::processPendingMsgMakeCallbacks ( )
protectedvirtual

Process a pending message and make any resulting federate ambassador callbacks.

virtual void DtAsyncConnectionMgr::processPendingMsgQueueCallbacks ( )
protectedvirtual

Process a pending message but queue any resulting federate ambassador callbacks.

Any resulting callback messages are put on receive queue.

virtual void DtAsyncConnectionMgr::queueMsg ( DtRtiMsg msg,
MAKRti::DtTransportType  transport,
const MAKRti::DtInetAddr &  addr = MAKRti::DtInetAddr::inaddrAny() 
)
protectedvirtual

method uses a mutex to lock the send queue while adding a a packet to the queue

virtual bool DtAsyncConnectionMgr::queueReceivePacket ( DtRtiMsg rtiMessage,
MAKRti::DtTransportType  transportType,
bool &  overflowWarning 
)
protectedvirtual

Put message on receive queue.

If queue is full, message will be deleted. Warning message will be produced for first deletion (repeated appropriately if IO queue diagnostics are enabled). Return true if message was placed on queue.

virtual int DtAsyncConnectionMgr::readFileDescriptor ( DtRtiApiTransportationType  transport)
virtual

Returns a file descriptor on which data will be present for the given transport type whenever there is incoming data waiting to be read.

Returns -1 if no such file descriptor.

On windows, always returns -1, use readFileEvent instead. On unix returns the file descriptor of the pipe used for inter-thread communication instead of the socket file descriptor. Transport type is ignored.

Reimplemented from DtConnectionMgr.

virtual DtNetReadStatus DtAsyncConnectionMgr::receivePacket ( DtRtiConnection conn,
MAKRti::DtTransportType  transportType,
unsigned int &  receivedPacketCount 
)
protectedvirtual

Process a packet from the given connection.

Depending on processing mode and the packet contents, the packet may result in messages placed on receive buffer. Packet count is incremented if messages are placed on receive buffer. Returns status of read on connection

virtual bool DtAsyncConnectionMgr::receivePackets ( )
protectedvirtual

Process connections and either place packets in receive queue or process messages directly if asynchronous callbacks are enabled.

Number processed packets is governed by lock queue ceiling Returns bool: more packets to read?

virtual void DtAsyncConnectionMgr::receiveThread ( )
virtual

worker thread (called by run)

virtual bool DtAsyncConnectionMgr::repairFederationConnection ( )
overrideprotectedvirtual

Attempt to re-establish a broken connection to the federation Returns true if successful.

Reimplemented from DtConnectionMgr.

static void* DtAsyncConnectionMgr::runReceive ( void *  usr)
static

thread start calls worker thread

static void* DtAsyncConnectionMgr::runSend ( void *  usr)
static
virtual int DtAsyncConnectionMgr::send ( const DtRtiMsg msg,
MAKRti::DtTransportType  transport,
const MAKRti::DtInetAddr &  addr = MAKRti::DtInetAddr::inaddrAny() 
)
virtual

Send a message.

Reimplemented from DtConnectionMgr.

virtual int DtAsyncConnectionMgr::sendAndDelete ( DtRtiMsg msg,
MAKRti::DtTransportType  transport,
const MAKRti::DtInetAddr &  addr = MAKRti::DtInetAddr::inaddrAny() 
)
virtual

Send a message and delete the message after it has been sent Retraction record of timestamped messages must made here.

Reimplemented from DtConnectionMgr.

virtual bool DtAsyncConnectionMgr::sendPackets ( )
protectedvirtual

Send buffered packets.

Moves a block of packets from send queue to send packet buffer and sends them on network. If blocked sending, then holds packets in buffer for next attempt. Flushes connections on exit. Returns bool: packets sent without being blocked (including no sends)?

virtual void DtAsyncConnectionMgr::sendThread ( )
virtual
virtual void DtAsyncConnectionMgr::setFederateMgr ( DtFederateMgr fedMgrPtr)
virtual

Set the federate manager.

Reimplemented from DtConnectionMgr.

virtual void DtAsyncConnectionMgr::setMessageTracking ( DtRtiMsg msg)
protectedvirtual

Set the appropriate tracking values in the message.

virtual void DtAsyncConnectionMgr::shutdown ( )
virtual

Request shutdown of communication activities.

Reimplemented from DtConnectionMgr.

Reimplemented in DtNetStatsAsyncConnMgr.

virtual void DtAsyncConnectionMgr::signalReceiveEvent ( )
virtual

Signal the receive event Used by IO thread to signal federate thread.

virtual void DtAsyncConnectionMgr::signalSendEvent ( )
virtual

Signal the send event Used by federate thread to signal IO thread.

virtual void DtAsyncConnectionMgr::startAsynchronousReceiveProcessing ( )
protectedvirtual

Start asynchronous processing.

virtual void DtAsyncConnectionMgr::startAsynchronousSendProcessing ( )
protectedvirtual
virtual void DtAsyncConnectionMgr::stopAsynchronousReceiveProcessing ( )
protectedvirtual

Stop asynchronous processing.

virtual void DtAsyncConnectionMgr::stopAsynchronousSendProcessing ( )
protectedvirtual
virtual void DtAsyncConnectionMgr::testIoIndicator ( const char *  label,
unsigned int  queueLevel,
unsigned int &  lowWaterLine,
unsigned int &  highWaterLine,
bool &  overflowWarning 
)
protectedvirtual

Test if the number of messages in an IO queue has exceeded the diagnostic indicator level.

Update indicator and output diagnostic if level has been reached.

virtual bool DtAsyncConnectionMgr::tick ( )
virtual

Process the connections for synchronous IO or callbacks.

Reimplemented from DtConnectionMgr.

virtual bool DtAsyncConnectionMgr::wait ( MAKRti::DtTime  periodInSeconds,
bool  unlockWhileWaiting = false 
)
virtual

Wait for data to be ready or the given period of time to expire Return boolean: data is ready for reading?

Reimplemented from DtConnectionMgr.

virtual int DtAsyncConnectionMgr::waitEvent ( )
virtual

return the waiting handle

virtual bool DtAsyncConnectionMgr::waitForConnectionRepair ( ) const
protectedvirtual

Threads not repairing a broken connection wait for it to be repaired.

virtual void DtAsyncConnectionMgr::yield ( )
virtual

Yield processing to allow more data to arrive.

Reimplemented from DtConnectionMgr.

Member Data Documentation

bool DtAsyncConnectionMgr::myAsynchronous
protected
bool DtAsyncConnectionMgr::myAsynchronousCallbacks
protected
DtThreadSafe<bool> DtAsyncConnectionMgr::myAsynchronousConnectionIsOk
protected
bool DtAsyncConnectionMgr::myAsynchronousProcessMsg
protected
DtCallbackQueue* DtAsyncConnectionMgr::myCallbackQueue
protected

A federate ambassador wrapper that queues up federate ambassador calls.

bool DtAsyncConnectionMgr::myConnectionIsUnderRepair
protected

Indicates that connection is under repair (used to coordinate repair with asynchronous processing)

bool DtAsyncConnectionMgr::myDoDisconnect
protected
int DtAsyncConnectionMgr::myInPostTick
protected
float DtAsyncConnectionMgr::myIoPeriod
protected
unsigned int DtAsyncConnectionMgr::myIoQueueIndicator
protected

These are pointers to the locations in the WaitEvent list they need to be dynamic in case one of them doesn't exist.

unsigned int DtAsyncConnectionMgr::myMaxCount
protected
unsigned int DtAsyncConnectionMgr::myMaxQueue
protected
bool DtAsyncConnectionMgr::myMoreToFlush
protected
unsigned int DtAsyncConnectionMgr::myNextReliableConnToRead
protected

Mechanism to track which reliable connection to fetch packets from when multiple ancillary reliable connections exist.

Must be set to zero whenever reliable connection is deleted.

bool DtAsyncConnectionMgr::myNonReflectedList[DtInvalidMsgKind+1]
protected
unsigned int DtAsyncConnectionMgr::myReadPacketCount
protected
bool DtAsyncConnectionMgr::myReadyToRepair
protected

Indicates that connection is ready to repair (used to coordinate repair with asynchronous processing))

bool DtAsyncConnectionMgr::myReceiveOverflowWarning
protected
DtAsycQueueType* DtAsyncConnectionMgr::myReceiveQueue
protected
unsigned int DtAsyncConnectionMgr::myReceiveQueueHighWaterLine
protected
unsigned int DtAsyncConnectionMgr::myReceiveQueueLowWaterLine
protected
bool DtAsyncConnectionMgr::myReceiveThreadActivated
protected
pthread_t DtAsyncConnectionMgr::myReceiveThreadHandle
protected
int DtAsyncConnectionMgr::myRecvEvent[2]
protected
char DtAsyncConnectionMgr::myRecvEventBuffer[100]
protected
DtMutex* DtAsyncConnectionMgr::myRepairMutex
protected

Mutex to synchronize access to connection repair lock.

bool DtAsyncConnectionMgr::myReserved
protected
int DtAsyncConnectionMgr::mySendEvent[2]
protected
char DtAsyncConnectionMgr::mySendEventBuffer[100]
protected
bool DtAsyncConnectionMgr::mySendOverflowWarning
protected
unsigned int DtAsyncConnectionMgr::mySendPacketCount
protected

Number of packets until time to yield (== max count)

DtAsycQueueType* DtAsyncConnectionMgr::mySendQueue
protected

Exchange queues between federate and IO threads these lists are used in asynchronous mode.

They contain pointers to DtQueuePacket's. They are not used when not operating asynchronously

unsigned int DtAsyncConnectionMgr::mySendQueueHighWaterLine
protected
unsigned int DtAsyncConnectionMgr::mySendQueueLowWaterLine
protected
bool DtAsyncConnectionMgr::mySendThreadActivated
protected
pthread_t DtAsyncConnectionMgr::mySendThreadHandle
protected
bool DtAsyncConnectionMgr::myShouldWaitOnCurrentBundle
protected

This determines whether the send thread should sleep after it attempts to send all packets, but there is still more to send due to bundling or socket send failures.

float DtAsyncConnectionMgr::myTickWaitPeriod
protected
bool DtAsyncConnectionMgr::myTimeToQuitReceiving
protected
bool DtAsyncConnectionMgr::myTimeToQuitSending
protected
DtSelectParamWithWrite DtAsyncConnectionMgr::myWaitEventsParams
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)