8 #ifndef DtRtiMsgForwarder_H_
9 #define DtRtiMsgForwarder_H_
19 #include <vlutil/vlRunnable.h>
20 #include <vlutil/vlThreadSafe.h>
23 #include <vlutil/vlSelectParamW.h>
24 #include <vlutil/vlSmartPointers.h>
25 #include <vlutil/vlInetAddr.h>
44 class DtMsgFwdrFunctor;
51 namespace rti1516_2025
76 const MAKRti::DtInetAddr& ipAddr,
int port,
77 unsigned long federateHandle = 0,
78 const MAKRti::DtString& federateName =
"",
79 const MAKRti::DtString& federateType =
"",
80 const MAKRti::DtString& fedexName =
"",
84 bool operator==(
const ConnectionInfo& rhs );
85 bool operator<(
const ConnectionInfo& rhs );
88 void setFederateInfo(
unsigned long fedexHandle,
unsigned long handle,
89 const MAKRti::DtString& name,
const MAKRti::DtString& type,
91 void setConnectionId(
unsigned long connId );
126 virtual bool hasExec()
const;
136 virtual void setEnableBundling(
unsigned int maxBundleSize );
139 virtual void setUseSmartForwarding(
bool yesNo );
142 virtual void setUseInternalSmartForwarding(
bool yesNo );
145 virtual void setRouteFedexMessages(
bool yesNo );
154 virtual inline unsigned long forwarderId()
const;
157 virtual void setForwarderId(
unsigned long newId);
160 virtual void updateTcpForwarderQueuedSockets();
163 virtual rti1516_2025::Authorizer* authorizer();
173 virtual ConnectionInfoSP getConnectionInfoByConnId(
unsigned long connId )
const;
176 virtual ConnectionInfoSP getConnectionInfoByHandle(
unsigned long federateHandle )
const;
182 virtual std::pair< bool, unsigned long > rtiExecConnected()
const;
190 virtual void requestCloseAllConnections();
197 virtual void requestKillSingleConnection(
const DtTcpMsgSocket* sock );
203 virtual void markConnectionAsAboutToBeDeleted(
DtTcpMsgSocket const* socket,
unsigned int connectionId);
206 virtual bool isConnectionMarkedForDeletion(
unsigned int connectionId)
const;
211 virtual void removeOldConnection(
unsigned int connectionId);
215 virtual void shutdownRequestedByExec();
220 virtual bool updateFederateConnectionId(
unsigned long orig,
unsigned long final );
223 virtual void updateConnectionProcessParameters(
unsigned long connId,
bool authorized,
unsigned long processId, MAKRti::DtString processName, MAKRti::DtString commandArgs );
226 virtual bool shouldStop();
244 virtual void performMcastDiscovery();
248 virtual void applyRegisteredFilters();
249 virtual void disableRegisteredFilters();
253 virtual void waitForIo();
260 virtual unsigned long consumeConnId();
270 virtual bool populateConnectionInformation(
271 unsigned int& numForwarderToForwarderConns,
272 std::vector<MAKRti::DtString>& forwarderIdentifiers,
273 std::vector<MAKRti::DtString>& forwarderConnectionHostNames,
274 std::vector<MAKRti::DtInetAddr>& forwarderConnectionAddrs,
275 unsigned int& numForwarderClientConns,
276 std::vector<MAKRti::DtString>& clientConnectionHostNames,
277 std::vector<MAKRti::DtInetAddr>& clientConnectionAddrs)
const;
280 virtual void closeAllConnectionsIfRequested();
int myPort
Port for local federate connections.
Definition: rtiMessageForwarder.h:307
unsigned long myProcessID
Definition: rtiMessageForwarder.h:97
DtFedexMsgFilter * myFedexMsgRouter
Fedex Routing Filter.
Definition: rtiMessageForwarder.h:328
DtHlaVersionId myHlaVersion
Definition: rtiMessageForwarder.h:105
bool myCloseAllConnectionsRequested
Connection shutdown requested?
Definition: rtiMessageForwarder.h:298
Helper class reads and prints message routing info in Verbose mode.
Definition: updateInterRoutingFilter.h:54
DtFederationShadowTrackingFilter * myFederationShadowMonitor
Definition: rtiMessageForwarder.h:319
MAKRti::DtString myCommandArgs
Definition: rtiMessageForwarder.h:104
virtual void preRunLoopEvent()
Plug-in defined Run Loop operations Gives users the ability to add functionality to the Run() loop wi...
Definition: rtiMessageForwarder.h:265
DtRoutePrinterFilter * myRoutePrinter
Smart DM Forwarding Filters.
Definition: rtiMessageForwarder.h:322
unsigned int myPacketBundleSize
Packet Bundle size (if bundle size = 0, bundling is disabled)
Definition: rtiMessageForwarder.h:315
virtual void postRunLoopEvent()
Definition: rtiMessageForwarder.h:267
unsigned long myConnId
Definition: rtiMessageForwarder.h:94
const DtRIDParameters & myParams
Local access to the RID Parameters.
Definition: rtiMessageForwarder.h:338
This class manages the RTI's start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
Helper class Routes internal messages according to attached subscriber lists.
Definition: updateInterRoutingFilter.h:114
Definition: rtiMessageForwarder.h:73
SocketToConnInfoMap myConnToConnInfoMap
Map from socket (conn) to ConnectionInfo object for that connection notes:
Definition: rtiMessageForwarder.h:350
Helper class monitors federation shadow connections and handles federation shadow handshaking and dis...
Definition: federationShadowTrackingFilter.h:28
Definition: tcpMsgSocketMgr.h:43
DtUniquePtr< rti1516_2025::Authorizer > myAuthorizer
Definition: rtiMessageForwarder.h:362
DtInternalRoutingFilter * myIntMsgRouter
Definition: rtiMessageForwarder.h:325
std::weak_ptr< ConnectionInfo > ConnectionInfoWP
Definition: rtiMessageForwarder.h:113
unsigned long myNextConnectionIdOffset
The ID to be assigned to the next Federate or Forwarder connection The IDs are offset from the forwar...
Definition: rtiMessageForwarder.h:312
DtHlaVersionId
Definition: rtiVersion.h:50
MAKRti::DtString myName
Definition: rtiMessageForwarder.h:100
virtual void runLoopEvent()
Definition: rtiMessageForwarder.h:266
Definition: rtiVersion.h:52
MAKRti::DtInetAddr myIp
Definition: rtiMessageForwarder.h:98
virtual const DtRtiMsgForwarder::SocketToConnInfoMap & getConnToConnInfoMap() const
WARNING: These methods are not thread-safe and may only be called by the back-end forwarder thread! ...
Definition: rtiMessageForwarder.h:371
Helper class captures DtNetConnectConfirmMsg Messages and extracts information required by the forwar...
Definition: connectConfirmFilter.h:23
unsigned long myHandle
Definition: rtiMessageForwarder.h:96
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
MAKRti::DtString myFederationName
Definition: rtiMessageForwarder.h:102
DtInternalRoutePrinterFilter * myInternalRoutePrinter
Definition: rtiMessageForwarder.h:323
unsigned long myForwarderId
Data Members.
Definition: rtiMessageForwarder.h:292
The DtMulitcastDiscoveryMgr can act as either a Requester or a Responder.
Definition: multicastDiscoveryMgr.h:33
DtRtiMsgForwarder *(* DtRtiMsgFwderCreator)(unsigned long, const DtRIDParameters ¶ms)
DtRtiMsgForwarder creator callback signature.
Definition: rtiMessageForwarder.h:58
MAKRti::DtInetAddr myForwarderAddr
Local host IP address (used by rtiExec monitor filter, among other uses)
Definition: rtiMessageForwarder.h:295
Helper class captures DtNetDeleteSocketMsg (DtNetConnectMsg) Messages and extracts information requir...
Definition: deleteSocketFilter.h:23
DtThreadSafe< std::deque< DtMsgFwdrFunctor * > > myPendingProxyCommands
Definition: rtiMessageForwarder.h:341
The DtTcpMsgSocket class provides an address family independent TCP socket that handles RTI messages...
Definition: tcpMsgSocket.h:40
DtMessageFilter is a base class for filters applied to DtFilteredTcpForwarder.
Definition: filteredTcpForwarder.h:33
std::map< const DtTcpMsgSocket *, ConnectionInfoSP > SocketToConnInfoMap
Definition: rtiMessageForwarder.h:114
unsigned long myFederationHandle
Definition: rtiMessageForwarder.h:95
Helper class monitors rtiexec connections and handles rtiexec handshaking and disconnects.
Definition: rtiExecTrackingFilter.h:34
static DtRtiMsgFwderCreator theCreator
Definition: rtiMessageForwarder.h:366
Fedex Msg Filter class: Ensures that message to/from the Fedex are delivered ONLY to required destina...
Definition: fedexMsgFilter.h:31
std::shared_ptr< ConnectionInfo > ConnectionInfoSP
Definition: rtiMessageForwarder.h:112
std::set< DtTcpMsgSocket const * > myConnectionsAboutToBeDeleted
Set of connections that when deleted there should be no complaint.
Definition: rtiMessageForwarder.h:353
DtDeleteSocketFilter * mySocketMonitor
Marks sockets that are being disconnected normally so that no complaint is given when they disconnect...
Definition: rtiMessageForwarder.h:335
int myPort
Definition: rtiMessageForwarder.h:99
MAKRti::DtString myProcessName
Definition: rtiMessageForwarder.h:103
DtBitMask myFedIdMask
Single bit mask for federate handle.
Definition: rtiMessageForwarder.h:109
DtRtiMsgForwarder manages connections and message distribution to local federates and remote Forwarde...
Definition: rtiMessageForwarder.h:65
DtMulitcastDiscoveryMgr myMcastDiscoveryMgr
Definition: rtiMessageForwarder.h:340
DtFilteredTcpForwarder * myTcpForwarder
Tcp Forwarder with Filtering Capabilities.
Definition: rtiMessageForwarder.h:301
const DtTcpMsgSocket * mySocket
Definition: rtiMessageForwarder.h:106
MAKRti::DtString myHostname
Definition: rtiMessageForwarder.h:360
bool myAuthorized
Definition: rtiMessageForwarder.h:93
DtBitMask represents a variable length bit-field which may be used to represent an array of boolean d...
Definition: bitMask.h:24
DtTcpMsgSocketMgr * mySocketMgr
Tcp Socket Manager (handles passive connections to Federates)
Definition: rtiMessageForwarder.h:304
DtRtiExecTrackingFilter * myRtiExecMonitor
If registered, Monitors rtiexec connection life-cycle.
Definition: rtiMessageForwarder.h:318
#define DT_DLL_FORWARDER
Definition: rtiMsConfig.h:153
MAKRti::DtString myType
Definition: rtiMessageForwarder.h:101
Helper class Routes Update and Interaction messages according to attached subscriber lists...
Definition: updateInterRoutingFilter.h:84
DtConnectConfirmFilter * myConnectConfirmFilter
Extracts info from connect confirm messages.
Definition: rtiMessageForwarder.h:331
MAKRti::DtSelectParamWithWrite mySelectParams
Definition: rtiMessageForwarder.h:355
Helper class reads and prints message routing info in Verbose mode.
Definition: updateInterRoutingFilter.h:27
int myTcpNoDelay
Definition: rtiMessageForwarder.h:308
DtFilteredTcpForwarder maintains a list of open connections and explodes received messages to all des...
Definition: filteredTcpForwarder.h:122
DtUpdateInterRoutingFilter * myDmMsgRouter
Definition: rtiMessageForwarder.h:324
bool myShouldStop
should this forwarder stop.
Definition: rtiMessageForwarder.h:358
std::vector< DtMessageFilter * > myRegisteredFilters
Registered Message Filters.
Definition: rtiMessageForwarder.h:344
virtual unsigned long forwarderId() const
Return the forwarder ID (defines the address space for connIds for this forwarder) ...
Definition: rtiMessageForwarder.h:376