![]() |
MAK RTIspy API Documentation for HLA 1516
|
DtRtiMsgForwarder manages connections and message distribution to local federates and remote Forwarders (if any). More...
Inheritance diagram for DtRtiMsgForwarder:
Collaboration diagram for DtRtiMsgForwarder:Classes | |
| struct | ConnectionInfo |
Public Types | |
| typedef DtBoost::shared_ptr < ConnectionInfo > | ConnectionInfoSP |
| typedef DtBoost::weak_ptr < ConnectionInfo > | ConnectionInfoWP |
| typedef std::map< const DtTcpMsgSocket *, ConnectionInfoSP > | SocketToConnInfoMap |
Public Member Functions | |
| virtual | ~DtRtiMsgForwarder () |
| Destructor. More... | |
| virtual void | init () |
| Initialize the forwarder (called by creator) More... | |
| virtual bool | hasExec () const |
| Query the rtiExec Handshake monitor for whether it has an exec. More... | |
| virtual void | run () |
| Main execution routine. More... | |
| virtual void | setEnableBundling (unsigned int maxBundleSize) |
| Get the rtiexec's socket if known. More... | |
| virtual void | setUseSmartForwarding (bool yesNo) |
| Enable Smart DM Subscription Filtering. More... | |
| virtual void | setUseInternalSmartForwarding (bool yesNo) |
| Enable Smart DM Subscription Filtering for internal messages. More... | |
| virtual void | setRouteFedexMessages (bool yesNo) |
| Enable Smart Fedex Message Filtering. More... | |
| virtual void | addPacketFilter (DtMessageFilter *filter) |
| [Un]Register a forwarding filter on incoming packets More... | |
| virtual void | removePacketFilter (DtMessageFilter *filter) |
| virtual unsigned long | forwarderId () const |
| Return the forwarder ID (defines the address space for connIds for this forwarder) More... | |
| virtual void | setForwarderId (unsigned long newId) |
| set the forwarder ID. More... | |
| void | updateTcpForwarderQueuedSockets () |
| update the tcp forwarders queued sockets More... | |
| virtual const DtRtiMsgForwarder::SocketToConnInfoMap & | getConnToConnInfoMap () const |
| WARNING: These methods are not thread-safe and may only be called by the back-end forwarder thread! More... | |
| virtual ConnectionInfoSP | getConnectionInfoByConnId (unsigned long connId) const |
| Get a shared pointer to the connection info for a connection by Conn ID. More... | |
| virtual ConnectionInfoSP | getConnectionInfoByHandle (unsigned long federateHandle) const |
| Get a shared pointer to the connection info for a connection by Federate Handle. More... | |
| virtual ConnectionInfoSP | getConnectionInfoBySocket (const DtTcpMsgSocket *sock) const |
| Get a shared pointer to the connection info for a connection by Socket. More... | |
| virtual std::pair< bool, unsigned long > | rtiExecConnected () const |
| Is the rtiexec connected and if so what is its connId? More... | |
| virtual void | sendMessage (const DtRtiMsg &msg, const DtTcpMsgSocket *src=0) |
| Send a message to all local sockets (filters will be applied) More... | |
| virtual void | requestCloseAllConnections () |
| Disconnect all open connections after this pass through run-loop completes. More... | |
| virtual void | requestKillSingleConnection (const DtTcpMsgSocket *sock) |
| Disconnect the requestedTcpSocket. More... | |
| virtual void | markConnectionAsAboutToBeDeleted (DtTcpMsgSocket const *socket, unsigned int connectionId) |
| Mark the given socket as one that is to be deleted silently. More... | |
| virtual bool | isConnectionMarkedForDeletion (unsigned int connectionId) const |
| Return boolean: given connection has been marked for deletion? More... | |
| virtual void | removeOldConnection (unsigned int connectionId) |
| Remove the socket specified by the given connection. More... | |
| virtual void | shutdownRequestedByExec () |
| Shutdown the forwarder application. More... | |
| virtual bool | updateFederateConnectionId (unsigned long orig, unsigned long final) |
| Set a locally connected federate's connId in the associated connection info struct. More... | |
| virtual void | updateConnectionProcessParameters (unsigned long connId, unsigned long processId, MAKRti::DtString processName, MAKRti::DtString commandArgs) |
| Set a connections process information. More... | |
| virtual bool | shouldStop () |
| should this forwarder stop. More... | |
Static Public Member Functions | |
| static DtRtiMsgForwarder * | create (unsigned long id, const DtRIDParameters ¶ms) |
| Create an instance of a DtRtiMsgForwarder. More... | |
| static void | setCreatorFunction (DtRtiMsgFwderCreator fn) |
| Call this function to set an alternate creator function With this function, users can replace this DtRtiMsgForwarder with their own derived class. More... | |
| static void | tcpSocketAdditionCb (DtTcpMsgSocket *sock, void *usr) |
| Callbacks on addition/removal of TCP sockets. More... | |
| static void | tcpSocketRemovalCb (DtTcpMsgSocket *sock, void *usr) |
Protected Member Functions | |
| DtRtiMsgForwarder (unsigned long id, const DtRIDParameters ¶ms) | |
| Default Constructor. More... | |
| virtual void | performMcastDiscovery () |
| virtual void | applyRegisteredFilters () |
| Enable / Disable all filters registered with forwarder. More... | |
| virtual void | disableRegisteredFilters () |
| virtual void | waitForIo () |
| Wait on sockets for next IO event (allows RTIspy users to control the wait mechanism and period) More... | |
| virtual void | tcpSocketAdditionCb (DtTcpMsgSocket *sock) |
| virtual void | tcpSocketRemovalCb (DtTcpMsgSocket *sock) |
| virtual unsigned long | consumeConnId () |
| Get and consume Connection ID. More... | |
| virtual void | preRunLoopEvent () |
| Plug-in defined Run Loop operations Gives users the ability to add functionality to the Run() loop without over-riding it completely. More... | |
| virtual void | runLoopEvent () |
| virtual void | postRunLoopEvent () |
| virtual bool | populateConnectionInformation (unsigned int &numForwarderToForwarderConns, std::vector< MAKRti::DtString > &forwarderIdentifiers, std::vector< MAKRti::DtString > &forwarderConnectionHostNames, std::vector< MAKRti::DtInetAddr > &forwarderConnectionAddrs, unsigned int &numForwarderClientConns, std::vector< MAKRti::DtString > &clientConnectionHostNames, std::vector< MAKRti::DtInetAddr > &clientConnectionAddrs) const |
| virtual void | closeAllConnectionsIfRequested () |
| Disconnect all open connections. More... | |
| DtRtiMsgForwarder (const DtRtiMsgForwarder &orig) | |
| Copy Ctor and Assignment Operator unimplemented. More... | |
| DtRtiMsgForwarder & | operator= (const DtRtiMsgForwarder &orig) |
Protected Attributes | |
| unsigned long | myForwarderId |
| Data Members. More... | |
| MAKRti::DtInetAddr | myForwarderAddr |
| Local host IP address (used by rtiExec monitor filter, among other uses) More... | |
| bool | myCloseAllConnectionsRequested |
| Connection shutdown requested? More... | |
| DtFilteredTcpForwarder * | myTcpForwarder |
| Tcp Forwarder with Filtering Capabilities. More... | |
| DtTcpMsgSocketMgr * | mySocketMgr |
| Tcp Socket Manager (handles passive connections to Federates) More... | |
| int | myPort |
| Port for local federate connections. More... | |
| int | myTcpNoDelay |
| unsigned long | myNextConnectionIdOffset |
| The ID to be assigned to the next Federate or Forwarder connection The IDs are offset from the forwarderId. More... | |
| unsigned int | myPacketBundleSize |
| Packet Bundle size (if bundle size = 0, bundling is disabled) More... | |
| DtRtiExecTrackingFilter * | myRtiExecMonitor |
| If registered, Monitors rtiexec connection life-cycle. More... | |
| DtRoutePrinterFilter * | myRoutePrinter |
| Smart DM Forwarding Filters. More... | |
| DtInternalRoutePrinterFilter * | myInternalRoutePrinter |
| DtUpdateInterRoutingFilter * | myDmMsgRouter |
| DtInternalRoutingFilter * | myIntMsgRouter |
| DtFedexMsgFilter * | myFedexMsgRouter |
| Fedex Routing Filter. More... | |
| DtConnectConfirmFilter * | myConnectConfirmFilter |
| Extracts info from connect confirm messages. More... | |
| DtDeleteSocketFilter * | mySocketMonitor |
| Marks sockets that are being disconnected normally so that no complaint is given when they disconnect versus abnormal disconnect. More... | |
| const DtRIDParameters & | myParams |
| Local access to the RID Parameters. More... | |
| DtMulitcastDiscoveryMgr | myMcastDiscoveryMgr |
| DtThreadSafe< std::deque < DtMsgFwdrFunctor * > > | myPendingProxyCommands |
| std::vector< DtMessageFilter * > | myRegisteredFilters |
| Registered Message Filters. More... | |
| SocketToConnInfoMap | myConnToConnInfoMap |
| Map from socket (conn) to ConnectionInfo object for that connection notes: More... | |
| std::set< DtTcpMsgSocket const * > | myConnectionsAboutToBeDeleted |
| Set of connections that when deleted there should be no complaint. More... | |
| MAKRti::DtSelectParamWithWrite | mySelectParams |
| bool | myShouldStop |
| should this forwarder stop. More... | |
| MAKRti::DtString | myHostname |
Static Protected Attributes | |
| static DtRtiMsgFwderCreator | theCreator |
DtRtiMsgForwarder manages connections and message distribution to local federates and remote Forwarders (if any).
It is designed to run as a thread, asynchronous to the main execution.
| typedef DtBoost::shared_ptr<ConnectionInfo> DtRtiMsgForwarder::ConnectionInfoSP |
| typedef DtBoost::weak_ptr<ConnectionInfo> DtRtiMsgForwarder::ConnectionInfoWP |
| typedef std::map< const DtTcpMsgSocket*, ConnectionInfoSP > DtRtiMsgForwarder::SocketToConnInfoMap |
|
protected |
Default Constructor.
|
virtual |
Destructor.
|
protected |
Copy Ctor and Assignment Operator unimplemented.
|
virtual |
[Un]Register a forwarding filter on incoming packets
|
protectedvirtual |
Enable / Disable all filters registered with forwarder.
|
protectedvirtual |
Disconnect all open connections.
|
protectedvirtual |
Get and consume Connection ID.
|
static |
Create an instance of a DtRtiMsgForwarder.
|
protectedvirtual |
|
inlinevirtual |
Return the forwarder ID (defines the address space for connIds for this forwarder)
References myForwarderId.
|
virtual |
Get a shared pointer to the connection info for a connection by Conn ID.
|
virtual |
Get a shared pointer to the connection info for a connection by Federate Handle.
|
virtual |
Get a shared pointer to the connection info for a connection by Socket.
|
inlinevirtual |
WARNING: These methods are not thread-safe and may only be called by the back-end forwarder thread!
Get a handle to the connection to connId map
References myConnToConnInfoMap.
|
virtual |
Query the rtiExec Handshake monitor for whether it has an exec.
|
virtual |
Initialize the forwarder (called by creator)
Reimplemented in DtExtendedRtiMsgForwarder.
|
virtual |
Return boolean: given connection has been marked for deletion?
|
virtual |
Mark the given socket as one that is to be deleted silently.
The forwarder won't complain when the given socket disconnects. If known, the socket connection ID should be provided A confirmation message is returned through the socket.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Plug-in defined Run Loop operations Gives users the ability to add functionality to the Run() loop without over-riding it completely.
|
virtual |
Remove the socket specified by the given connection.
Used by reconnect to clean up orphaned sockets where client detected break but server has not.
|
virtual |
|
virtual |
Disconnect all open connections after this pass through run-loop completes.
|
virtual |
Disconnect the requestedTcpSocket.
Introduced so that the rtiExecTrackingFilter can have connections deleted. The alternative is that the myTcpForwarder be made publicly accessible. Filter will call this on sockets from which it receives rtiExecReconnectMsgs when it is still connected to the rtiExec, and connect and disconnect messages from the exec when we are still connected and are not connected to the rtiExec respectively.
|
virtual |
Is the rtiexec connected and if so what is its connId?
|
virtual |
Main execution routine.
|
inlineprotectedvirtual |
|
virtual |
Send a message to all local sockets (filters will be applied)
|
static |
Call this function to set an alternate creator function With this function, users can replace this DtRtiMsgForwarder with their own derived class.
|
virtual |
Get the rtiexec's socket if known.
Enable Message Bundling optimization
|
virtual |
set the forwarder ID.
|
virtual |
Enable Smart Fedex Message Filtering.
|
virtual |
Enable Smart DM Subscription Filtering for internal messages.
|
virtual |
Enable Smart DM Subscription Filtering.
|
virtual |
should this forwarder stop.
|
virtual |
Shutdown the forwarder application.
Triggered by the rtiExec sending a forwarderShutdown message to the RTI Forwarder.
|
static |
Callbacks on addition/removal of TCP sockets.
|
protectedvirtual |
Reimplemented in DtExtendedRtiMsgForwarder.
|
static |
|
protectedvirtual |
Reimplemented in DtExtendedRtiMsgForwarder.
|
virtual |
Set a connections process information.
|
virtual |
Set a locally connected federate's connId in the associated connection info struct.
This should only need to be invoked when the forwarder is part of the federate's Forwarder Group, but not its primary forwarder.
| void DtRtiMsgForwarder::updateTcpForwarderQueuedSockets | ( | ) |
update the tcp forwarders queued sockets
|
protectedvirtual |
Wait on sockets for next IO event (allows RTIspy users to control the wait mechanism and period)
|
protected |
Connection shutdown requested?
|
protected |
Extracts info from connect confirm messages.
|
protected |
Set of connections that when deleted there should be no complaint.
|
protected |
Map from socket (conn) to ConnectionInfo object for that connection notes:
Referenced by getConnToConnInfoMap().
|
protected |
|
protected |
Fedex Routing Filter.
|
protected |
Local host IP address (used by rtiExec monitor filter, among other uses)
|
protected |
Data Members.
Address space for connection IDs for this LAN (required to differentiate when there are multiple forwarders)
Referenced by forwarderId().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The ID to be assigned to the next Federate or Forwarder connection The IDs are offset from the forwarderId.
|
protected |
Packet Bundle size (if bundle size = 0, bundling is disabled)
|
protected |
Local access to the RID Parameters.
|
protected |
|
protected |
Port for local federate connections.
|
protected |
Registered Message Filters.
|
protected |
Smart DM Forwarding Filters.
|
protected |
If registered, Monitors rtiexec connection life-cycle.
|
protected |
|
protected |
should this forwarder stop.
|
protected |
Tcp Socket Manager (handles passive connections to Federates)
|
protected |
Marks sockets that are being disconnected normally so that no complaint is given when they disconnect versus abnormal disconnect.
|
protected |
Tcp Forwarder with Filtering Capabilities.
|
protected |
|
staticprotected |