MAK RTIspy API Documentation for HLA Evolved
 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 | Protected Attributes | Static Protected Attributes
DtInOutForwarderPort Class Reference

The DtForwarderPort is an Abstract Base Class which provides the interface to a collection of connections from which messages may be read and to which messages may be sent. More...

+ Inheritance diagram for DtInOutForwarderPort:
+ Collaboration diagram for DtInOutForwarderPort:

Public Member Functions

virtual ~DtInOutForwarderPort ()
 
virtual bool isReady () const
 Is the Port fully usable and available? More...
 
virtual DtAddressMsgPair getNextMsg ()
 Get the next message to forward and the source connection. More...
 
virtual bool getInitializationMsgs (DtForwarderPort::DtSocketSet &socks, std::list< DtAddressMsgPair > &msgs, bool printBeDestMetadata)
 Get the next initialization messages off of a set of pending TCP sockets. More...
 
virtual bool getInitializationMsg (DtMsgSocket *sock, DtAddressMsgPair &msg, bool printBeDestMetadata)
 Get the next initialization message off of a pending TCP socket. More...
 
virtual void sendByTransport (const DtForwarderMsg &msg) const
 Check transport metadata and send message to appropriate destinations. More...
 
virtual void sendToAllReliable (const DtForwarderMsg &msg) const
 Send a message to all available destinations. More...
 
virtual void sendToListReliable (const DtForwarderMsg &msg, const DtAddressPortList &destinations) const
 Send a message to the specified list of destinations excluding the list of filtered destinations. More...
 
virtual void selectParams (MAKRti::DtSelectParamWithWrite &selectParams)
 Add this port's current select() notification set to the passed set. More...
 
virtual void updateRoutes ()
 Handle changes to the Routing map. More...
 
virtual void processInitializationMessages ()
 
virtual void processConnectionMessages (const DtAddressMsgPair &msgPair)
 
virtual int checkConnectionStatus (const DtInetAddrAndPort *target=0)
 Test for lost connections - returns true if targeted connection is active or if no target specified returns false if at least one drop detected. More...
 
virtual bool fixConnection (DtTcpMsgSocket *sock)
 
virtual void clearNeededConnections ()
 Clear the list of needed forwarder connections. More...
 
virtual unsigned int abortPendingConnections ()
 Abort any embryonic connections. More...
 
virtual unsigned int pendingConnectionsAborted ()
 Return a count of aborted or failed connection attempts. More...
 
virtual DtAddressPortList connections () const
 Get the list of all current connections to this port. More...
 
virtual bool updateFederateConnectionId (unsigned long orig, unsigned long final)
 Update locally connected federate connection ID (LAN-port-only) More...
 
virtual bool flush ()
 Flush any pending messages. More...
 
virtual bool flushOnly ()
 Flush any pending messages. Does not do any socket disconnect processing. More...
 
virtual DtString connectionListToString (const char *separator=" : ") const
 Print the current connection list. More...
 
virtual bool populateConnectionInformation (unsigned int &numForwarderToForwarderConns, std::vector< DtString > &forwarderIdentifiers, std::vector< DtString > &forwarderConnectionHostNames, std::vector< DtInetAddrAndPort > &forwarderConnectionAddrs) const
 
virtual bool addPeerConnection (const DtString &host, const MAKRti::DtInetAddr &ipAddress, int port, bool distributeConnection)
 Add a peer connection. More...
 
virtual void processMacAddrMsg (const DtForwarderPort::DtAddressMsgPair &msg)
 Process a message giving the populated DtMacAddrMsg from a forwarder. More...
 
virtual void processPortMsg (const DtForwarderPort::DtAddressMsgPair &msgPair)
 Process a message indicating the listening port of the forwarder on the other end of a socket. More...
 
virtual void processForwarderNodeInfoMsg (const DtForwarderPort::DtAddressMsgPair &msg)
 Process a message giving the connection information from a forwarder. More...
 
virtual void processConnectToForwarderMsg (const DtForwarderPort::DtAddressMsgPair &msg)
 Process a message to connect to another forwarder. More...
 
virtual void listenToMulticastGroup (const MAKRti::DtInetAddr &mcastAddr)
 Listen / drop multicast groups (not implemented in this class) More...
 
virtual void dropMulticastGroup (const MAKRti::DtInetAddr &mcastAddr)
 Listen / drop multicast groups (not implemented in this class) More...
 
- Public Member Functions inherited from DtForwarderPort
virtual ~DtForwarderPort ()
 
virtual bool isOk () const
 Is the Port still alive? More...
 
virtual void setForwarderId (unsigned long id)
 Set forwarder ID. More...
 
virtual void addConnectionEstablishedCb (DtConnectionAddRemoveCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void removeConnectionEstablishedCb (DtConnectionAddRemoveCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void addConnectionLostCb (DtConnectionAddRemoveCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void removeConnectionLostCb (DtConnectionAddRemoveCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void addConnectionChangedCb (DtConnectionChangeCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void removeConnectionChangedCb (DtConnectionChangeCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void addReconnectBegun (DtConnectionReconnectBegunCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void removeReconnectBegun (DtConnectionReconnectBegunCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void addReconnectComplete (DtConnectionReconnectCompleteCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void removeReconnectComplete (DtConnectionReconnectCompleteCb callback, void *usr)
 Register/Unregister callback for addition/removal/change of connections. More...
 
virtual void addForwarderPortReadyCb (DtPortReadyCb callback, void *usr)
 Register/Unregister callback for event - forwarder port becomes ready. More...
 
virtual void removeForwarderPortReadyCb (DtPortReadyCb callback, void *usr)
 Register/Unregister callback for event - forwarder port becomes ready. More...
 
virtual void addFederateJoinedCb (DtFederateAddedCb callback, void *usr)
 Register/Unregister callback for event - federate join/resign. More...
 
virtual void removeFederateJoinedCb (DtFederateAddedCb callback, void *usr)
 Register/Unregister callback for event - federate join/resign. More...
 
virtual void addFederateResignedCb (DtFederateRemovedCb callback, void *usr)
 Register/Unregister callback for event - federate join/resign. More...
 
virtual void removeFederateResignedCb (DtFederateRemovedCb callback, void *usr)
 Register/Unregister callback for event - federate join/resign. More...
 
virtual void addSocketQueueCb (DtSocketQueueCb callback, void *usr)
 Register/Unregister callback for event - socket queue status changes. More...
 
virtual void removeSocketQueueCb (DtSocketQueueCb callback, void *usr)
 Register/Unregister callback for event - socket queue status changes. More...
 
virtual void addWaitingForForwarderConnectionsCb (DtWaitingForFwsCb callback, void *usr)
 Register/Unregister callback for event - entrance/exit the "waiting for forwarder connections" state. More...
 
virtual void removeWaitingForForwarderConnectionsCb (DtWaitingForFwsCb callback, void *usr)
 Register/Unregister callback for event - entrance/exit the "waiting for forwarder connections" state. More...
 
virtual void addNotWaitingForForwarderConnectionsCb (DtNotWaitingForFwsCb callback, void *usr)
 Register/Unregister callback for event - entrance/exit the "waiting for forwarder connections" state. More...
 
virtual void removeNotWaitingForForwarderConnectionsCb (DtNotWaitingForFwsCb callback, void *usr)
 Register/Unregister callback for event - entrance/exit the "waiting for forwarder connections" state. More...
 
virtual void addExecConnectionEstablishedCb (DtExecAddChangeCb callback, void *usr)
 Register/Unregister callback for event - exec connected/disconnected. More...
 
virtual void removeExecConnectionEstablishedCb (DtExecAddChangeCb callback, void *usr)
 Register/Unregister callback for event - exec connected/disconnected. More...
 
virtual void addExecDisconnectedCb (DtExecRemovedChangeCb callback, void *usr)
 Register/Unregister callback for event - exec connected/disconnected. More...
 
virtual void removeExecDisconnectedCb (DtExecRemovedChangeCb callback, void *usr)
 Register/Unregister callback for event - exec connected/disconnected. More...
 
virtual int execConnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &addr, const MAKRti::DtString &hostName, bool fullyCompliant)
 Called when the exec connects/disconnects. More...
 
virtual int execDisconnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &addr)
 Called when the exec connects/disconnects. More...
 

Static Public Member Functions

static DtForwarderPortcreate (const DtRIDParameters *params, const DtBoost::shared_ptr< DtRouteMap > routes, const MAKRti::DtInetAddr &host, int forwarderPort, const MAKRti::DtInetEndpoint &additionalForwarderToConnectTo)
 Creates an instance of a DtInOutForwarderPort. More...
 
static void setCreatorFunction (DtForwarderPortCreatorFcn creator)
 Call this function to set an alternate creator function With this function, users can replace this DtInOutForwarderPort with their own derived class. More...
 

Protected Member Functions

 DtInOutForwarderPort (const DtRIDParameters *params, DtBoost::shared_ptr< DtRouteMap > routes, const MAKRti::DtInetAddr &host, int forwarderPort, const MAKRti::DtInetEndpoint &forwarderAddrToConnectTo)
 Base Ctor - called by default creator. More...
 
virtual void initializeConnections ()
 Initiates a connection to each adjacent node. More...
 
virtual void sendMacAddrMsg (DtTcpMsgSocket *sock)
 Send a populated DtMacAddrMsg to the specified socket. More...
 
virtual void sendPortMsg (DtTcpMsgSocket *sock)
 Send a message indicating our local socket port for the given socket. More...
 
virtual void sendForwarderNodeInfoMsgToConnections ()
 Send the forwarder node info message to all the connections (and post pending) More...
 
virtual void sendForwarderNodeInfoMsg (DtTcpMsgSocket *sock, unsigned long nodeIdToUse=0)
 Send the forwarder node info message to the given socket. More...
 
virtual void sendConnectToForwarderMsg (const DtInetAddrAndPort &fwDestination, const DtString &fwName, const DtString &fwHostName)
 Send a message to connect to another forwarder to all peer forwarders. More...
 
virtual bool connectToPeer (const DtInetAddrAndPort &addrToConnectTo)
 Returns whether sock was ok() More...
 
virtual int processLostConnection (DtTcpMsgSocket *sock)
 Handle lost connections. More...
 
virtual void connectionCompleted (const DtInetAddrAndPort &addrAndPort, DtTcpMsgSocket *sock)
 The new socket has been processed (either via routes files or dynamically). More...
 
virtual void connectionCompleted (const DtString &nodeName, const DtString &hostName, unsigned long nodeId, const DtInetAddrAndPort &addrAndPort, DtTcpMsgSocket *sock)
 The new socket has been processed (either via routes files or dynamically). More...
 
virtual void addSocketUsingRoutesFile (DtTcpMsgSocket *sock, const DtInetAddrAndPort &addrAndPort)
 Add this socket to connection using routes file information. More...
 
virtual void addInitiatedSocketDynamically (DtTcpMsgSocket *sock, const DtInetAddrAndPort &addrAndPort)
 Add socket we initiated to connections dynamically. More...
 
virtual void addReceivedSocketDynamically (DtTcpMsgSocket *sock, const DtInetAddrAndPort &addrAndPort)
 Add socket we received to connections dynamically. More...
 
virtual DtTcpMsgSocketsocketFromListeningAddr (const DtInetAddrAndPort &addrAndPort)
 
virtual bool removeFromPendingList (DtTcpMsgSocket *addr)
 Remove a connection from the pending list (return true if found and removed) More...
 
virtual void becomeRootForwarderNode ()
 Sets this forwarder node as the root. More...
 
virtual void distributeConnections (const DtInetAddrAndPort &fwAddrAndPort, const DtString &fwName, const DtString &fwHostName, const std::set< DtForwarderNodeInfo > &fwConnPeers)
 Distribute the given connection and its peers to this forwarder's peers. More...
 
 DtInOutForwarderPort ()
 Default Ctor, Copy Ctor, Assignment - unimplemented. More...
 
 DtInOutForwarderPort (const DtInOutForwarderPort &orig)
 
DtInOutForwarderPortoperator= (const DtInOutForwarderPort &orig)
 
virtual void addConnection (const DtInetAddrAndPort &newConn, DtTcpMsgSocket *sock)
 
virtual void removeConnection (DtAddrToConnMap::iterator pos)
 
- Protected Member Functions inherited from DtForwarderPort
 DtForwarderPort (const DtRIDParameters *params, DtBoost::shared_ptr< DtRouteMap > routes, MAKRti::DtInetAddr host, int forwarderPort, MAKRti::DtInetEndpoint addnlConnection)
 
virtual void forwarderNodeIsReady (unsigned long id)
 Called when the forwarder port is known and node becomes ready. More...
 
virtual int socketQueueStatus (unsigned int connId, int connQueueStatus)
 Called when the socket queue status changes. More...
 
virtual void waitingForForwarderConnections (const DtConnAndNameMap &allNeededFws, const DtConnAndNameMap &stillNeededFws)
 Specifies that this port is waiting for other forwarder connections. More...
 
virtual void notWaitingForForwarderConnections ()
 Called when exiting from the waiting for forwarder connections state. More...
 
virtual int connectionEstablished (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &addr)
 Call when connection is added/removed/changed Invokes callbacks registered for this event. More...
 
virtual int connectionLost (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &addr)
 Call when connection is added/removed/changed Invokes callbacks registered for this event. More...
 
virtual int connectionChanged (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int oldConnID, unsigned int newConnID, const DtInetAddrAndPort &addr)
 Call when connection is added/removed/changed Invokes callbacks registered for this event. More...
 
int reconnectBegun (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const DtInetAddrAndPort &addr)
 Call when connection is added/removed/changed Invokes callbacks registered for this event. More...
 
int reconnectComplete (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const DtInetAddrAndPort &addr, bool wasSuccessful)
 Call when connection is added/removed/changed Invokes callbacks registered for this event. More...
 
virtual void federateResigned (const MAKRti::DtString &connName, const MAKRti::DtString &connType, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &addr)
 Called when the federate joins/resigns. More...
 
virtual void federateJoined (const MAKRti::DtString &connName, const MAKRti::DtString &connType, const MAKRti::DtString &federationName, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &addr, const MAKRti::DtString &hostName, unsigned int processId, const MAKRti::DtString &processName, const MAKRti::DtString &commandArgs, DtHlaVersionId hlaVersion)
 Called when the federate joins/resigns. More...
 

Protected Attributes

bool myIsReady
 
DtPeerToPeerTcpSockMgrmyConnectionMgr
 
DtForwarderPort::DtAddrToConnMap myConnections
 
DtForwarderPort::DtAddrToConnMap::const_iterator myNextConnection
 
DtForwarderPort::DtAddrToConnMap::const_iterator myLastConnection
 
DtInetAddrAndPort myLocalDestination
 
DtInetAddrAndPort myPendingPeerAddition
 
DtAddrToConnMap mySocketToBeRemoved
 Duplicate connections to be deleted on processPortMsg. More...
 
std::map< DtInetAddrAndPort,
DtTcpMsgSocket * > 
myAddrToSockMap
 
std::map< DtTcpMsgSocket
*, unsigned long > 
mySockToIdMap
 
DtForwarderPort::DtSocketSet myPendingConnections
 Connections which are in process. More...
 
DtForwarderPort::DtSocketSet myPrePendingConnections
 
DtForwarderPort::DtSocketSet myPostPendingConnections
 
DtForwarderPort::DtSocketSet myUnknownPortConnections
 
DtForwarderPort::DtSocketSet myDynamicallyInitiatedConnections
 
DtForwarderPort::DtSocketSet myDynamicallyReceivedConnections
 
std::map< DtInetAddrAndPort,
DtString > 
myNeededConnections
 Connections needed before the forwarding network is complete. More...
 
std::map< DtInetAddrAndPort,
DtString > 
myStillNeededConnections
 Connections still needed before the forwarding network is complete. More...
 
std::map< DtInetAddrAndPort,
DtInetAddrAndPort
myUsedToListeningMap
 Map of actual address/port pairs to listening address/port pairs, which are also used for identification. More...
 
std::map< DtInetAddrAndPort,
DtInetAddrAndPort
myListeningToUsedMap
 
DtForwarderPort::DtSocketList myInitiatedConnections
 
DtForwarderPort::DtSocketSet myExpiredConnections
 
DtForwarderPort::DtSocketSet myDiscardedRemoteSockets
 
DtUdpMsgSocketmyLegacyUdpConnection
 
std::map< DtInetAddrAndPort,
unsigned long long > 
myMacAddrsOfConnectedForwardersMap
 
bool myIsRootForwarderNode
 
MAKRti::DtClock myClock
 
std::map< DtTcpMsgSocket
*, MAKRti::DtTime > 
mySktSendTimeMap
 
std::map< DtTcpMsgSocket
*, unsigned int > 
myTestCountFailureMap
 
MAKRti::DtInetDevice myHostIf
 The interface used for connections with other forwarders. More...
 
int myCompressionLevel
 
MAKRti::DtString myHostname
 
unsigned long myMsgCount
 
- Protected Attributes inherited from DtForwarderPort
const DtRIDParametersmyParams
 
DtBoost::shared_ptr< DtRouteMapmyRoutes
 
const MAKRti::DtInetAddr myAddress
 
bool myOk
 
int myPortToUse
 
MAKRti::DtInetEndpoint myAdditionalAddrToConnectTo
 
DtConnectionAddRemoveCallbackList myConnectionEstablishedCbs
 
DtConnectionAddRemoveCallbackList myConnectionLostCbs
 
DtConnectionReconnectBegunCallbackList myReconnectBegunCbs
 
DtConnectionReconnectCompleteCallbackList myReconnectCompleteCbs
 
DtConnectionChangeCallbackList myConnectionChangedCbs
 
DtFederateAddedCallbackList myFederateJoinedCbs
 
DtFederateRemovedCallbackList myFederateResignedCbs
 
DtPortReadyCallbackList myPortReadyCbs
 
DtExecAddedCallbackList myExecConnectedCbs
 
DtExecRemovedCallbackList myExecDisconnectedCbs
 
DtSocketQueueCallbackList mySocketQueueCbs
 
DtWaitingForFwsCallbackList myWaitingForFwsCbs
 
DtNotWaitingForFwsCallbackList myNotWaitingForFwsCbs
 

Static Protected Attributes

static DtForwarderPortCreatorFcn theCreator
 
virtual void socketAdditionCb (DtTcpMsgSocket *sock)
 Callback for new connections. More...
 
static void socketAdditionCb (DtTcpMsgSocket *sock, void *usr)
 Callback for new connections. More...
 
virtual void socketEstablishedCb (DtTcpMsgSocket *sock)
 Callback for established connections. More...
 
static void socketEstablishedCb (DtTcpMsgSocket *sock, void *usr)
 Callback for established connections. More...
 
virtual void socketRemovalCb (DtTcpMsgSocket *sock)
 Callback for dropped connections. More...
 
static void socketRemovalCb (DtTcpMsgSocket *sock, void *usr)
 Callback for dropped connections. More...
 

Additional Inherited Members

- Public Types inherited from DtForwarderPort
typedef DtForwarderPort *(* DtForwarderPortCreatorFcn )(const DtRIDParameters *, const DtBoost::shared_ptr< DtRouteMap >, const MAKRti::DtInetAddr &, int, const MAKRti::DtInetEndpoint &)
 DtForwarderPort creator signature. More...
 
typedef
DtRouteMap::DtAddressPortList 
DtAddressPortList
 
typedef DtRouteMap::DtAddressList DtAddressList
 
typedef
DtRouteMap::DtInterfaceAddrSet 
DtInterfaceAddrSet
 
typedef std::vector
< DtTcpMsgSocket * > 
DtSocketList
 
typedef std::set
< DtTcpMsgSocket * > 
DtSocketSet
 
typedef std::pair
< DtInetAddrAndPort,
DtForwarderMsg
DtAddressMsgPair
 
typedef std::pair
< DtTcpMsgSocket
*, DtForwarderMsg
DtSockMsgPair
 
typedef std::map
< DtInetAddrAndPort,
DtTcpMsgSocket * > 
DtAddrToConnMap
 
typedef std::map
< DtInetAddrAndPort,
MAKRti::DtString > 
DtConnAndNameMap
 
typedef int(* DtConnectionAddRemoveCb )(const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &, void *)
 
typedef int(* DtConnectionReconnectBegunCb )(const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, const DtInetAddrAndPort &, void *)
 
typedef int(* DtConnectionReconnectCompleteCb )(const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, const DtInetAddrAndPort &, bool, void *)
 
typedef int(* DtConnectionChangeCb )(const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, unsigned int, const DtInetAddrAndPort &, void *)
 
typedef void(* DtFederateAddedCb )(const MAKRti::DtString &, const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, unsigned int, const DtInetAddrAndPort &, const MAKRti::DtString &, unsigned int, const MAKRti::DtString &, const MAKRti::DtString &, DtHlaVersionId, void *)
 
typedef void(* DtFederateRemovedCb )(const MAKRti::DtString &, const MAKRti::DtString &, unsigned int, unsigned int, const DtInetAddrAndPort &, void *)
 
typedef void(* DtPortReadyCb )(unsigned long, void *)
 
typedef int(* DtExecAddChangeCb )(const MAKRti::DtString &, unsigned int, const DtInetAddrAndPort &, const MAKRti::DtString &, bool, void *)
 
typedef int(* DtExecRemovedChangeCb )(const MAKRti::DtString &, unsigned int, const DtInetAddrAndPort &, void *)
 
typedef int(* DtSocketQueueCb )(unsigned int, int, void *)
 
typedef void(* DtWaitingForFwsCb )(const DtConnAndNameMap &, const DtConnAndNameMap &, void *)
 
typedef void(* DtNotWaitingForFwsCb )(void *)
 
typedef std::vector< std::pair
< DtConnectionAddRemoveCb,
void * > > 
DtConnectionAddRemoveCallbackList
 
typedef std::vector< std::pair
< DtConnectionReconnectBegunCb,
void * > > 
DtConnectionReconnectBegunCallbackList
 
typedef std::vector< std::pair
< DtConnectionReconnectCompleteCb,
void * > > 
DtConnectionReconnectCompleteCallbackList
 
typedef std::vector< std::pair
< DtConnectionChangeCb, void * > > 
DtConnectionChangeCallbackList
 
typedef std::vector< std::pair
< DtFederateAddedCb, void * > > 
DtFederateAddedCallbackList
 
typedef std::vector< std::pair
< DtFederateRemovedCb, void * > > 
DtFederateRemovedCallbackList
 
typedef std::vector< std::pair
< DtPortReadyCb, void * > > 
DtPortReadyCallbackList
 
typedef std::vector< std::pair
< DtExecAddChangeCb, void * > > 
DtExecAddedCallbackList
 
typedef std::vector< std::pair
< DtExecRemovedChangeCb, void * > > 
DtExecRemovedCallbackList
 
typedef std::vector< std::pair
< DtSocketQueueCb, void * > > 
DtSocketQueueCallbackList
 
typedef std::vector< std::pair
< DtWaitingForFwsCb, void * > > 
DtWaitingForFwsCallbackList
 
typedef std::vector< std::pair
< DtNotWaitingForFwsCb, void * > > 
DtNotWaitingForFwsCallbackList
 
- Static Protected Member Functions inherited from DtForwarderPort
static int socketQueueStatus (unsigned int connId, int connQueueStatus, void *usr)
 Callback function registered to be called when socket queue status changes. More...
 
static void forwarderNodeIsReady (unsigned long id, void *usr)
 Callback function registered to be called when forwarder node is ready (port is known) More...
 
static int connectionEstablished (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &addr, void *usr)
 Callback function registered to be called when connection is added/removed/changed. More...
 
static int connectionLost (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int connID, const std::pair< DtInetAddrAndPort, DtInetAddrAndPort > &addr, void *usr)
 Callback function registered to be called when connection is added/removed/changed. More...
 
static int connectionChanged (const MAKRti::DtString &connName, const MAKRti::DtString &hostName, unsigned int oldConnID, unsigned int newConnID, const DtInetAddrAndPort &addr, void *usr)
 Callback function registered to be called when connection is added/removed/changed. More...
 
static void federateJoined (const MAKRti::DtString &connName, const MAKRti::DtString &connType, const MAKRti::DtString &federationName, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &addr, const MAKRti::DtString &hostName, unsigned int processId, const MAKRti::DtString &processName, const MAKRti::DtString &commandArgs, DtHlaVersionId hlaVersion, void *usr)
 Callback function registered to be called when federate joins/resigns. More...
 
static void federateResigned (const MAKRti::DtString &connName, const MAKRti::DtString &connType, unsigned int connID, unsigned int fedHandle, const DtInetAddrAndPort &addr, void *usr)
 Callback function registered to be called when federate joins/resigns. More...
 
static int execConnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &addr, const MAKRti::DtString &hostName, bool fullyCompliant, void *usr)
 Callback function registered to be called when exec connects/disconnects. More...
 
static int execDisconnected (const MAKRti::DtString &connName, unsigned int connID, const DtInetAddrAndPort &addr, void *usr)
 Callback function registered to be called when exec connects/disconnects. More...
 

Detailed Description

The DtForwarderPort is an Abstract Base Class which provides the interface to a collection of connections from which messages may be read and to which messages may be sent.

Constructor & Destructor Documentation

DtInOutForwarderPort::DtInOutForwarderPort ( const DtRIDParameters params,
DtBoost::shared_ptr< DtRouteMap routes,
const MAKRti::DtInetAddr &  host,
int  forwarderPort,
const MAKRti::DtInetEndpoint &  forwarderAddrToConnectTo 
)
protected

Base Ctor - called by default creator.

virtual DtInOutForwarderPort::~DtInOutForwarderPort ( )
virtual
DtInOutForwarderPort::DtInOutForwarderPort ( )
protected

Default Ctor, Copy Ctor, Assignment - unimplemented.

DtInOutForwarderPort::DtInOutForwarderPort ( const DtInOutForwarderPort orig)
protected

Member Function Documentation

virtual unsigned int DtInOutForwarderPort::abortPendingConnections ( )
virtual

Abort any embryonic connections.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::addConnection ( const DtInetAddrAndPort newConn,
DtTcpMsgSocket sock 
)
protectedvirtual
virtual void DtInOutForwarderPort::addInitiatedSocketDynamically ( DtTcpMsgSocket sock,
const DtInetAddrAndPort addrAndPort 
)
protectedvirtual

Add socket we initiated to connections dynamically.

virtual bool DtInOutForwarderPort::addPeerConnection ( const DtString &  host,
const MAKRti::DtInetAddr &  ipAddress,
int  port,
bool  distributeConnection 
)
virtual

Add a peer connection.

virtual void DtInOutForwarderPort::addReceivedSocketDynamically ( DtTcpMsgSocket sock,
const DtInetAddrAndPort addrAndPort 
)
protectedvirtual

Add socket we received to connections dynamically.

virtual void DtInOutForwarderPort::addSocketUsingRoutesFile ( DtTcpMsgSocket sock,
const DtInetAddrAndPort addrAndPort 
)
protectedvirtual

Add this socket to connection using routes file information.

virtual void DtInOutForwarderPort::becomeRootForwarderNode ( )
protectedvirtual

Sets this forwarder node as the root.

virtual int DtInOutForwarderPort::checkConnectionStatus ( const DtInetAddrAndPort target = 0)
virtual

Test for lost connections - returns true if targeted connection is active or if no target specified returns false if at least one drop detected.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::clearNeededConnections ( )
virtual

Clear the list of needed forwarder connections.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::connectionCompleted ( const DtInetAddrAndPort addrAndPort,
DtTcpMsgSocket sock 
)
protectedvirtual

The new socket has been processed (either via routes files or dynamically).

Record established connection.

virtual void DtInOutForwarderPort::connectionCompleted ( const DtString &  nodeName,
const DtString &  hostName,
unsigned long  nodeId,
const DtInetAddrAndPort addrAndPort,
DtTcpMsgSocket sock 
)
protectedvirtual

The new socket has been processed (either via routes files or dynamically).

Record established connection.

virtual DtString DtInOutForwarderPort::connectionListToString ( const char *  separator = " : ") const
virtual

Print the current connection list.

virtual DtAddressPortList DtInOutForwarderPort::connections ( ) const
virtual

Get the list of all current connections to this port.

Implements DtForwarderPort.

virtual bool DtInOutForwarderPort::connectToPeer ( const DtInetAddrAndPort addrToConnectTo)
protectedvirtual

Returns whether sock was ok()

static DtForwarderPort* DtInOutForwarderPort::create ( const DtRIDParameters params,
const DtBoost::shared_ptr< DtRouteMap routes,
const MAKRti::DtInetAddr &  host,
int  forwarderPort,
const MAKRti::DtInetEndpoint &  additionalForwarderToConnectTo 
)
static

Creates an instance of a DtInOutForwarderPort.

virtual void DtInOutForwarderPort::distributeConnections ( const DtInetAddrAndPort fwAddrAndPort,
const DtString &  fwName,
const DtString &  fwHostName,
const std::set< DtForwarderNodeInfo > &  fwConnPeers 
)
protectedvirtual

Distribute the given connection and its peers to this forwarder's peers.

virtual void DtInOutForwarderPort::dropMulticastGroup ( const MAKRti::DtInetAddr &  mcastAddr)
inlinevirtual

Listen / drop multicast groups (not implemented in this class)

Implements DtForwarderPort.

virtual bool DtInOutForwarderPort::fixConnection ( DtTcpMsgSocket sock)
virtual
virtual bool DtInOutForwarderPort::flush ( )
virtual

Flush any pending messages.

Reimplemented from DtForwarderPort.

virtual bool DtInOutForwarderPort::flushOnly ( )
virtual

Flush any pending messages. Does not do any socket disconnect processing.

virtual bool DtInOutForwarderPort::getInitializationMsg ( DtMsgSocket sock,
DtAddressMsgPair msg,
bool  printBeDestMetadata 
)
virtual

Get the next initialization message off of a pending TCP socket.

virtual bool DtInOutForwarderPort::getInitializationMsgs ( DtForwarderPort::DtSocketSet socks,
std::list< DtAddressMsgPair > &  msgs,
bool  printBeDestMetadata 
)
virtual

Get the next initialization messages off of a set of pending TCP sockets.

virtual DtAddressMsgPair DtInOutForwarderPort::getNextMsg ( )
virtual

Get the next message to forward and the source connection.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::initializeConnections ( )
protectedvirtual

Initiates a connection to each adjacent node.

virtual bool DtInOutForwarderPort::isReady ( ) const
virtual

Is the Port fully usable and available?

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::listenToMulticastGroup ( const MAKRti::DtInetAddr &  mcastAddr)
inlinevirtual

Listen / drop multicast groups (not implemented in this class)

Implements DtForwarderPort.

DtInOutForwarderPort& DtInOutForwarderPort::operator= ( const DtInOutForwarderPort orig)
protected
virtual unsigned int DtInOutForwarderPort::pendingConnectionsAborted ( )
virtual

Return a count of aborted or failed connection attempts.

Implements DtForwarderPort.

virtual bool DtInOutForwarderPort::populateConnectionInformation ( unsigned int &  numForwarderToForwarderConns,
std::vector< DtString > &  forwarderIdentifiers,
std::vector< DtString > &  forwarderConnectionHostNames,
std::vector< DtInetAddrAndPort > &  forwarderConnectionAddrs 
) const
virtual
virtual void DtInOutForwarderPort::processConnectionMessages ( const DtAddressMsgPair msgPair)
virtual
virtual void DtInOutForwarderPort::processConnectToForwarderMsg ( const DtForwarderPort::DtAddressMsgPair msg)
virtual

Process a message to connect to another forwarder.

virtual void DtInOutForwarderPort::processForwarderNodeInfoMsg ( const DtForwarderPort::DtAddressMsgPair msg)
virtual

Process a message giving the connection information from a forwarder.

virtual void DtInOutForwarderPort::processInitializationMessages ( )
virtual
virtual int DtInOutForwarderPort::processLostConnection ( DtTcpMsgSocket sock)
protectedvirtual

Handle lost connections.

virtual void DtInOutForwarderPort::processMacAddrMsg ( const DtForwarderPort::DtAddressMsgPair msg)
virtual

Process a message giving the populated DtMacAddrMsg from a forwarder.

virtual void DtInOutForwarderPort::processPortMsg ( const DtForwarderPort::DtAddressMsgPair msgPair)
virtual

Process a message indicating the listening port of the forwarder on the other end of a socket.

virtual void DtInOutForwarderPort::removeConnection ( DtAddrToConnMap::iterator  pos)
protectedvirtual
virtual bool DtInOutForwarderPort::removeFromPendingList ( DtTcpMsgSocket addr)
protectedvirtual

Remove a connection from the pending list (return true if found and removed)

virtual void DtInOutForwarderPort::selectParams ( MAKRti::DtSelectParamWithWrite &  selectParams)
virtual

Add this port's current select() notification set to the passed set.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::sendByTransport ( const DtForwarderMsg msg) const
virtual

Check transport metadata and send message to appropriate destinations.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::sendConnectToForwarderMsg ( const DtInetAddrAndPort fwDestination,
const DtString &  fwName,
const DtString &  fwHostName 
)
protectedvirtual

Send a message to connect to another forwarder to all peer forwarders.

virtual void DtInOutForwarderPort::sendForwarderNodeInfoMsg ( DtTcpMsgSocket sock,
unsigned long  nodeIdToUse = 0 
)
protectedvirtual

Send the forwarder node info message to the given socket.

Set the recipient node with the given ID.

virtual void DtInOutForwarderPort::sendForwarderNodeInfoMsgToConnections ( )
protectedvirtual

Send the forwarder node info message to all the connections (and post pending)

virtual void DtInOutForwarderPort::sendMacAddrMsg ( DtTcpMsgSocket sock)
protectedvirtual

Send a populated DtMacAddrMsg to the specified socket.

virtual void DtInOutForwarderPort::sendPortMsg ( DtTcpMsgSocket sock)
protectedvirtual

Send a message indicating our local socket port for the given socket.

virtual void DtInOutForwarderPort::sendToAllReliable ( const DtForwarderMsg msg) const
virtual

Send a message to all available destinations.

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::sendToListReliable ( const DtForwarderMsg msg,
const DtAddressPortList destinations 
) const
virtual

Send a message to the specified list of destinations excluding the list of filtered destinations.

Implements DtForwarderPort.

static void DtInOutForwarderPort::setCreatorFunction ( DtForwarderPortCreatorFcn  creator)
static

Call this function to set an alternate creator function With this function, users can replace this DtInOutForwarderPort with their own derived class.

static void DtInOutForwarderPort::socketAdditionCb ( DtTcpMsgSocket sock,
void *  usr 
)
staticprotected

Callback for new connections.

virtual void DtInOutForwarderPort::socketAdditionCb ( DtTcpMsgSocket sock)
protectedvirtual

Callback for new connections.

static void DtInOutForwarderPort::socketEstablishedCb ( DtTcpMsgSocket sock,
void *  usr 
)
staticprotected

Callback for established connections.

virtual void DtInOutForwarderPort::socketEstablishedCb ( DtTcpMsgSocket sock)
protectedvirtual

Callback for established connections.

virtual DtTcpMsgSocket* DtInOutForwarderPort::socketFromListeningAddr ( const DtInetAddrAndPort addrAndPort)
protectedvirtual
static void DtInOutForwarderPort::socketRemovalCb ( DtTcpMsgSocket sock,
void *  usr 
)
staticprotected

Callback for dropped connections.

virtual void DtInOutForwarderPort::socketRemovalCb ( DtTcpMsgSocket sock)
protectedvirtual

Callback for dropped connections.

bool DtInOutForwarderPort::updateFederateConnectionId ( unsigned long  orig,
unsigned long  final 
)
inlinevirtual

Update locally connected federate connection ID (LAN-port-only)

Implements DtForwarderPort.

virtual void DtInOutForwarderPort::updateRoutes ( )
virtual

Handle changes to the Routing map.

Implements DtForwarderPort.

Member Data Documentation

std::map<DtInetAddrAndPort, DtTcpMsgSocket*> DtInOutForwarderPort::myAddrToSockMap
protected
MAKRti::DtClock DtInOutForwarderPort::myClock
protected
int DtInOutForwarderPort::myCompressionLevel
protected
DtPeerToPeerTcpSockMgr* DtInOutForwarderPort::myConnectionMgr
protected
DtForwarderPort::DtAddrToConnMap DtInOutForwarderPort::myConnections
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myDiscardedRemoteSockets
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myDynamicallyInitiatedConnections
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myDynamicallyReceivedConnections
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myExpiredConnections
protected
MAKRti::DtInetDevice DtInOutForwarderPort::myHostIf
protected

The interface used for connections with other forwarders.

MAKRti::DtString DtInOutForwarderPort::myHostname
protected
DtForwarderPort::DtSocketList DtInOutForwarderPort::myInitiatedConnections
protected
bool DtInOutForwarderPort::myIsReady
protected
bool DtInOutForwarderPort::myIsRootForwarderNode
protected
DtForwarderPort::DtAddrToConnMap::const_iterator DtInOutForwarderPort::myLastConnection
protected
DtUdpMsgSocket* DtInOutForwarderPort::myLegacyUdpConnection
protected
std::map<DtInetAddrAndPort, DtInetAddrAndPort> DtInOutForwarderPort::myListeningToUsedMap
protected
DtInetAddrAndPort DtInOutForwarderPort::myLocalDestination
protected
std::map<DtInetAddrAndPort, unsigned long long> DtInOutForwarderPort::myMacAddrsOfConnectedForwardersMap
protected
unsigned long DtInOutForwarderPort::myMsgCount
protected
std::map<DtInetAddrAndPort, DtString> DtInOutForwarderPort::myNeededConnections
protected

Connections needed before the forwarding network is complete.

DtForwarderPort::DtAddrToConnMap::const_iterator DtInOutForwarderPort::myNextConnection
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myPendingConnections
protected

Connections which are in process.

DtInetAddrAndPort DtInOutForwarderPort::myPendingPeerAddition
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myPostPendingConnections
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myPrePendingConnections
protected
std::map< DtTcpMsgSocket*, MAKRti::DtTime > DtInOutForwarderPort::mySktSendTimeMap
mutableprotected
DtAddrToConnMap DtInOutForwarderPort::mySocketToBeRemoved
protected

Duplicate connections to be deleted on processPortMsg.

std::map<DtTcpMsgSocket*, unsigned long> DtInOutForwarderPort::mySockToIdMap
protected
std::map<DtInetAddrAndPort, DtString> DtInOutForwarderPort::myStillNeededConnections
protected

Connections still needed before the forwarding network is complete.

std::map< DtTcpMsgSocket *, unsigned int> DtInOutForwarderPort::myTestCountFailureMap
protected
DtForwarderPort::DtSocketSet DtInOutForwarderPort::myUnknownPortConnections
protected
std::map<DtInetAddrAndPort, DtInetAddrAndPort> DtInOutForwarderPort::myUsedToListeningMap
protected

Map of actual address/port pairs to listening address/port pairs, which are also used for identification.

DtForwarderPortCreatorFcn DtInOutForwarderPort::theCreator
staticprotected

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

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)