19 #include <vlutil/vlThreadSafe.h>
20 #include <vlutil/vlMutex.h>
21 #include <vlutil/vlLockfreeQueue.h>
27 #include <vlutil/vlSelectParamW.h>
33 class DtSelectParamWithWrite;
43 MAKRti::DtTransportType transport,
44 const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny() );
65 std::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
66 std::shared_ptr<DtRtiAssistantLrcClient>() );
86 virtual bool isAsynchronous();
91 #
if defined(DtIFSPEC13) || defined(DtIFSPEC1516)
92 RTI_API::FederateAmbassador* fedAmb,
95 MAKRti::DtString fedExName,
101 virtual void queueMsg(
DtRtiMsg* msg,
102 MAKRti::DtTransportType transport,
103 const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny() );
107 MAKRti::DtTransportType transport,
108 const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny() );
113 MAKRti::DtTransportType transport,
114 const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny() );
136 virtual bool flush();
139 virtual void receiveThread();
140 virtual void sendThread();
144 virtual bool wait( MAKRti::DtTime periodInSeconds,
bool unlockWhileWaiting =
false );
157 virtual HANDLE waitEvent();
164 virtual int waitEvent();
170 virtual void signalReceiveEvent();
174 virtual void clearReceiveEvent();
178 virtual void signalSendEvent();
182 virtual void clearSendEvent();
185 virtual void yield();
196 virtual bool doReceiveProcessing(
unsigned long timeout);
199 virtual void doDisconnectFederation();
202 virtual bool doWait(MAKRti::DtTime period);
211 virtual bool sendPackets();
219 MAKRti::DtTransportType transportType,
unsigned int& receivedPacketCount);
225 virtual bool receivePackets();
231 unsigned int& receivedPacketCount);
235 virtual void processPendingMsgQueueCallbacks();
238 virtual void processPendingMsgMakeCallbacks();
241 virtual void setMessageTracking(
DtRtiMsg& msg);
245 virtual void destroyPackets();
257 virtual void startAsynchronousReceiveProcessing();
258 virtual void startAsynchronousSendProcessing();
261 virtual void stopAsynchronousReceiveProcessing();
262 virtual void stopAsynchronousSendProcessing();
276 virtual bool queueReceivePacket(
DtRtiMsg* rtiMessage, MAKRti::DtTransportType transportType,
277 bool& overflowWarning);
281 virtual void testIoIndicator(
const char* label,
unsigned int queueLevel,
282 unsigned int& lowWaterLine,
unsigned int& highWaterLine,
bool& overflowWarning);
288 std::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
289 std::shared_ptr<DtRtiAssistantLrcClient>() );
293 static unsigned long runReceive(
void* usr );
294 static unsigned long runSend(
void* usr );
296 static void* runReceive(
void* usr );
297 static void* runSend(
void* usr );
320 HANDLE myReceiveThreadHandle;
321 HANDLE mySendThreadHandle;
322 HANDLE myReceiveWaitEvent;
323 HANDLE* myWaitEvents;
324 HANDLE mySendWaitEvent;
325 unsigned int myNumWaitEvents;
363 unsigned int myWaitEvent_BestEffortConn;
364 unsigned int myWaitEvent_PrimaryReliableConn;
365 unsigned int myWaitEvent_AncillaryReliableConnStart;
366 unsigned int myNoBestEffort;
382 char myRecvEventBuffer[100];
383 char mySendEventBuffer[100];
virtual void destroyAncillaryRelConn(DtRtiConnection *conn)
Destroy the given ancillary reliable connection.
pthread_t myReceiveThreadHandle
Definition: asyConMgr.h:328
unsigned int myIoQueueIndicator
These are pointers to the locations in the WaitEvent list they need to be dynamic in case one of them...
Definition: asyConMgr.h:369
virtual bool processConnections()
Check all the connections and process any incomming messages Return boolean: message was received...
virtual DtRtiMsg * getMessage()
Get a message if one exists Message must be destroyed by caller.
MAKRti::DtLockfreeQueue< DtQueuePacket * > DtAsycQueueType
Definition: asyConMgr.h:53
bool myReserved
Definition: asyConMgr.h:313
float myTickWaitPeriod
Definition: asyConMgr.h:335
DtAsycQueueType * mySendQueue
Exchange queues between federate and IO threads these lists are used in asynchronous mode...
Definition: asyConMgr.h:347
DtNetReadStatus
Definition: connection.h:21
pthread_t mySendThreadHandle
Definition: asyConMgr.h:329
virtual bool processConnectionsInCallback()
unsigned int myReadPacketCount
Definition: asyConMgr.h:341
This class manages the RTI's start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
Definition: fedTimeFactory.h:73
virtual bool doWait(MAKRti::DtTime period)
perform actual wait. Called by wait
unsigned int mySendQueueLowWaterLine
Definition: asyConMgr.h:373
RTI_API::TransportationTypeHandle DtRtiApiTransportationType
Definition: rtiApiTypes.h:114
This class represents a network connection with another RTI component.
Definition: connection.h:38
bool myTimeToQuitSending
Definition: asyConMgr.h:306
bool mySendOverflowWarning
Definition: asyConMgr.h:375
bool myAsynchronousProcessMsg
Definition: asyConMgr.h:312
the Asynchronous Connection Mgr adds asynchronous I/O to the connectionMgr class. ...
Definition: asyConMgr.h:60
MAKRti::DtTransportType transport
Definition: asyConMgr.h:50
Includes either 1.3 or 1516 federate ambassador callback queue.
bool myTimeToQuitReceiving
Definition: asyConMgr.h:307
float myIoPeriod
Definition: asyConMgr.h:334
This file contains the declaration of the Connection Manager.
virtual int send(const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
Sending.
virtual void setFederateMgr(DtFederateMgr *fedMgrPtr)
Set the federate manager.
bool myAsynchronousCallbacks
Definition: asyConMgr.h:311
Note: no message kind may be > DtInvalidMsgKind This is a limitation imposed by the RTI Msg Header - ...
Definition: rtiMsgKind.h:162
virtual void shutdown()
Request shutdown of communication activities.
unsigned int myReceiveQueueLowWaterLine
Definition: asyConMgr.h:370
virtual void yield()
Yield processing to allow more data to arrive.
DtRtiMsg * msg
Definition: asyConMgr.h:48
virtual void disconnectFederation()
The LRC disassociates its connections from the federation.
bool myAsynchronous
Definition: asyConMgr.h:310
virtual bool flush()
Send buffered messages.
unsigned int mySendPacketCount
Number of packets until time to yield (== max count)
Definition: asyConMgr.h:340
unsigned int myMaxCount
Definition: asyConMgr.h:337
DtThreadSafe< bool > myAsynchronousConnectionIsOk
Definition: asyConMgr.h:353
Instances of DtFederateMgr process federation-level messages (such as create, destroy, join, resign, and sync points) and manages the objects responsible for handling general communication, objects, interactions, the FOM, MOM, and data distribution mmg.
Definition: fedMgr.h:93
virtual void destroyAncillaryRelConns()
Destroy ancillary reliable connections.
DtAsycQueueType * myReceiveQueue
Definition: asyConMgr.h:348
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:67
int myInPostTick
Definition: asyConMgr.h:317
virtual void destroyRelConn()
Destroy reliable connection.
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
DtHandle DtFederateHandle
Definition: internalTypes.h:46
unsigned int myNextReliableConnToRead
Mechanism to track which reliable connection to fetch packets from when multiple ancillary reliable c...
Definition: asyConMgr.h:358
virtual int readFileDescriptor(DtRtiApiTransportationType transport)
Returns a file descriptor on which data will be present for the given transport type whenever there i...
unsigned int mySendQueueHighWaterLine
Definition: asyConMgr.h:374
MAKRti::DtInetAddr addr
Definition: asyConMgr.h:49
Definition: asyConMgr.h:37
bool myDoDisconnect
Definition: asyConMgr.h:315
unsigned int myMaxQueue
Definition: asyConMgr.h:336
virtual bool createBestEffortConn()
Create best effort connection; Returns true if successful Could be that it already exist in which cas...
virtual bool tick()
Receiving.
bool mySendThreadActivated
Definition: asyConMgr.h:308
virtual void connectFederation(DtLogicalTimeFactory *logicalTimeFactoryPtr, MAKRti::DtString fedExName, DtFederateHandle federateHandle, int fedExHandle)
The LRC associates its federation information with its network connections.
unsigned int myReceiveQueueHighWaterLine
Definition: asyConMgr.h:371
#define DT_DLL_LRC
Definition: rtiMsConfig.h:155
bool myReceiveThreadActivated
Definition: asyConMgr.h:309
bool myShouldWaitOnCurrentBundle
This determines whether the send thread should sleep after it attempts to send all packets...
Definition: asyConMgr.h:380
virtual int init(DtRIDParameters *params)
Initialize the RTI's exercise parameters and connections Users who wish to override the MAK RTI's net...
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 Returns the size of the data sent...
virtual DtRtiMsg * create(DtRtiMsgKind kind)
Request the RTI message factory for a msg.
bool myReceiveOverflowWarning
Definition: asyConMgr.h:372
virtual DtNetReadStatus handleMsg(DtRtiMsg &msg)
Handle this message by either processing it or queuing it if save pending.
bool myMoreToFlush
Definition: asyConMgr.h:314
DtCallbackQueue * myCallbackQueue
A federate ambassador wrapper that queues up federate ambassador calls.
Definition: asyConMgr.h:351
A message that delivers stored callbacks generated by asynchronous thread.
Definition: fedAmbCallbackMsg.h:34
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 rea...
DtSelectParamWithWrite myWaitEventsParams
Definition: asyConMgr.h:327