MAK RTIspy API Documentation for HLA 1516
 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 Types | Protected Member Functions | Protected Attributes | Private Member Functions
DtRtiAssistantServer Class Reference

Manages the server connections of the RTI Assistant. More...

+ Collaboration diagram for DtRtiAssistantServer:

Public Member Functions

 DtRtiAssistantServer (DtNotifyLevelType level, int port=DtASSISTANT_DEFAULT_PORT, const MAKRti::DtInetAddr &networkInterface=MAKRti::DtInetAddr())
 Constructor, networkInterface defaults to INADDR_ANY.
virtual ~DtRtiAssistantServer ()
 Destructor.
bool isOk () const
 Returns true if the server was successfully started.
virtual void addMsgCallback (DtAssistantMsgKind msgKind, DtAssistantMsgCbMgr::DtCallbackFcn fcn, void *usr)
 Message Callbacks These callback functions operate on all of the connections.
virtual void removeMsgCallback (DtAssistantMsgKind msgKind, DtAssistantMsgCbMgr::DtCallbackFcn fcn, void *usr)
virtual void addWildcardMsgCallback (DtAssistantMsgCbMgr::DtCallbackFcn fcn, void *usr)
virtual void removeWildcardMsgCallback (DtAssistantMsgCbMgr::DtCallbackFcn fcn, void *usr)
virtual void addSocketAdditionCallback (DtAssistantSocketAdditionCb cb, void *usr)
 These functions add callbacks for notification of the addition or removal of Assistant socket connections.
virtual void removeSocketAdditionCallback (DtAssistantSocketAdditionCb cb, void *usr)
virtual void addSocketRemovalCallback (DtAssistantSocketRemovalCb cb, void *usr)
virtual void removeSocketRemovalCallback (DtAssistantSocketRemovalCb cb, void *usr)
virtual bool tick (double timeout=0)
 Do the actual message processing.
virtual unsigned int numConnections () const
 Return the number of current RTI component connections.
virtual void sendMsgOnConn (int compId, const DtAssistantMsg &msg)
 Send the message over the specified connection.
virtual void sendBroadcast (const DtAssistantMsg &msg)
 Send the message over the all connections.
virtual void sendConnMsg (int compId, bool disconnect=false, const MAKRti::DtString &display=MAKRti::DtString::nullString())
 Sends a component ID back to a connecting component.
virtual void sendConnRespMsg (int compId, const DtRtiConnectionInfoDataPair &conn, const DtRtiConnectionConfigurationInfo &config, bool accepted)
 Sends a connection query response message.
virtual void sendLicRespMsg (int compId, bool runUnlicensed, const MAKRti::DtString &server, int port, bool accepted)
 Sends a license query response message.
virtual void sendAssistantCommandResponseMsg (int compId, const MAKRti::DtString &formattedData)
 Sends a response to an assistant command message.
virtual void sendForwarderConnectMsg (int compId, const MAKRti::DtString &targetHost, const MAKRti::DtInetAddr &targetAddress, int targetPort)
 Sends a connect to forwarder message to a forwarder component.
virtual void sendNtfyLvlUpdateMsg (int compId, DtNotifyLevelType notifyLevel)
 Sends a notify level update message.
virtual void sendLatencyTestRequestMsg (int compId, bool runTest, bool continuous, bool shouldHalt, bool observing, unsigned int interactionPeriod, unsigned int numInteractions, unsigned int payloadBytes, unsigned long federationHandle=0, unsigned long initFedHandle=0)
 Sends an initiate latency test request message.
virtual void sendNetworkTestEnableMsg (int compId, int federationHdl, bool enable)
 Sends a message enabling or disabling network testing for the given federation.
virtual void sendLogEnableMsg (int compId, bool enable)
 Sends a logging enable message.
virtual void sendObserveRtiexecMsg (int compId, bool isObserved, unsigned int timeStateIntervalMs)
 Sends a message to tell an rtiexec that it should either start or stop sending its information.
virtual void sendObserveRtiexecLogMsg (int connId, bool isObserved)
 Sends a message to tell an rtiexec that it should either start or stop sending its log information.
virtual void sendObserveRtiForwarderMsg (int compId, bool isObserved, unsigned int timeStateIntervalMs, int defunctRemovalTime)
 Sends a message to tell an RTI Forwarder that it should either start or stop sending its information.
virtual void sendSingleObserveRtiExecMsg (int compId)
 Sends a message to tell a local rtiExec that it should send its data one time only.
virtual void sendSingleObserveForwarderMsg (int compId)
 Sends a message to tell a local forwarder that it should send its data one time only.
virtual void sendFederateResignMsg (int compId, int federationHdl, int federateHdl)
 Sends a force federate resign message to an rtiexec.
virtual void sendFederationDestroyMsg (int compId, int federationHdl)
 Sends a force federation destroy message to an rtiexec.
virtual void sendDeleteFederateMsg (int compId, DtU16 fedexHandle, DtU16 fedHandle)
 Sends a message to tell an rtiexec that it shold delete a federate.
virtual void sendRidParamsRequestMsg (int compId)
 Sends a RID parameter request to an rtiexec.
virtual void sendLogRequestMsg (int compId, unsigned maxLogSize)
 Sends a log request to an rtiexec.
virtual void sendNetStatsObservationRequestMsg (DtAssistantObservationType observationType, int compId, bool observe=false, unsigned int interval=0)
 Sends a Observation Request to an local component.
virtual void sendExitMsg (int compId=-1)
 Sends an exit command message for the specified component, or for all components if none specified.
virtual void sendDoNotWaitForForwardersMsg (int compId)
 Sends a message to the specified forwarder telling it to proceed without waiting for any more forwarders to connect.
virtual void forwardMsg (const DtAssistantMsg &msg)
 Forwards a message from a remote assistant to the local component that is its final destination.
virtual void sendSignalTickIntervalMsg (int compId, float signalTickInterval)
 sends the signal tick interval
virtual int currentCompId () const
 Returns the component ID from which the current message being processed was received, or -1 if there is no such message.
virtual void closeConn (int compId)
 Close the connection with the given component ID.
virtual int port () const
 Returns the Assistant server port.
virtual DtU32 maxMsgSize () const
 Gets the maximum message size.
virtual const DtInetAddr & getNetworkAddr ()

Static Public Member Functions

static void tcpSocketAdditionCb (DtTcpMsgSocket *sock, void *usr)
 Callbacks on addition/removal of TCP sockets.
static void tcpSocketRemovalCb (DtTcpMsgSocket *sock, void *usr)

Protected Types

typedef std::map< int,
DtTcpMsgSocket * > 
CompIdToSocketMap
 Maps of the connections and component IDs.
typedef std::map
< DtTcpMsgSocket *, int > 
SocketToCompIdMap

Protected Member Functions

virtual void sendMsg (DtTcpMsgSocket *sock, const DtAssistantMsg &msg)
 Sends the message over the specified socket.
virtual void testConnections ()
 Verify connection status and mark bad connections for removal.
virtual bool readAndProcess (DtTime maxTimePerSocket)
 Make a single pass over the socket list allocating up to max.
virtual void tcpSocketAdditionCb (DtTcpMsgSocket *sock)
 Callbacks on addition/removal of TCP sockets.
virtual void tcpSocketRemovalCb (DtTcpMsgSocket *sock)
virtual std::auto_ptr
< DtAssistantMsg
netRead (DtTcpMsgSocket *sock, int *retCode) const
 Read a message from a socket.
virtual void setMsgFactory (DtAssistantMessageFactory *fact)
 Get/Set the message factory .
virtual DtAssistantMessageFactorymsgFactory () const

Protected Attributes

SocketToCompIdMap myIdsByConnection
 Map of component IDs by connection.
CompIdToSocketMap myConnectionsById
 Map of connections by component ID.
int myNextCompId
 Next component ID to use.
DtAssistantMessageFactorymyMessageFactory
 The message factory.
DtAssistantDfltMsgFactory myDefaultMessageFactory
 Default message factory.
DtTcpMsgSocketmyCurrentSocket
 The socket on which the current message being processed was received.
unsigned int myPort
 Port to which RTI components may connect.
DtClock myClock
 Clock for timeouts.
DtTime myConnTestInterval
 Interval at which connections should be tested.
DtTime myTimeToTestConnections
 Next time to test connections.
std::auto_ptr< DtTcpMsgSocketMgrmySocketMgr
 Manager for the sockets.
MAKRti::DtInetAddr myNetworkInterface
 Network Interface.
std::list< DtTcpMsgSocket * > mySocketsToDisconnect
 List of sockets to be disconnected before next read.
DtAssistantMsgCbMgr myMsgCbMgr
 Message callback manager.
std::map< int, MAKRti::DtString > myDisconnectReasons
 List of reasons for socket disconnects.
DtAssistantSocketAdditionCallbackList myAdditionCallbacks
 Lists of pointers to socket addition and socket removal callbacks.
DtAssistantSocketRemovalCallbackList myRemovalCallbacks
unsigned myNumMsgsSent
 Total messages sent.
unsigned myNumMsgsReceived
 Total messages received.

Private Member Functions

 DtRtiAssistantServer (const DtRtiAssistantServer &)
 Copy and Assignment unimplemented.
DtRtiAssistantServeroperator= (const DtRtiAssistantServer &)

Detailed Description

Manages the server connections of the RTI Assistant.

DtRtiAssistantServer manages the connections of the RTI Assistant. It also provides methods for packaging and sending messages to the connected RTI components.

Member Typedef Documentation

typedef std::map< int, DtTcpMsgSocket* > DtRtiAssistantServer::CompIdToSocketMap
protected

Maps of the connections and component IDs.

typedef std::map< DtTcpMsgSocket*, int > DtRtiAssistantServer::SocketToCompIdMap
protected

Constructor & Destructor Documentation

DtRtiAssistantServer::DtRtiAssistantServer ( DtNotifyLevelType  level,
int  port = DtASSISTANT_DEFAULT_PORT,
const MAKRti::DtInetAddr &  networkInterface = MAKRti::DtInetAddr() 
)

Constructor, networkInterface defaults to INADDR_ANY.

virtual DtRtiAssistantServer::~DtRtiAssistantServer ( )
virtual

Destructor.

DtRtiAssistantServer::DtRtiAssistantServer ( const DtRtiAssistantServer )
private

Copy and Assignment unimplemented.

Member Function Documentation

virtual void DtRtiAssistantServer::addMsgCallback ( DtAssistantMsgKind  msgKind,
DtAssistantMsgCbMgr::DtCallbackFcn  fcn,
void *  usr 
)
virtual

Message Callbacks These callback functions operate on all of the connections.

virtual void DtRtiAssistantServer::addSocketAdditionCallback ( DtAssistantSocketAdditionCb  cb,
void *  usr 
)
virtual

These functions add callbacks for notification of the addition or removal of Assistant socket connections.

virtual void DtRtiAssistantServer::addSocketRemovalCallback ( DtAssistantSocketRemovalCb  cb,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::addWildcardMsgCallback ( DtAssistantMsgCbMgr::DtCallbackFcn  fcn,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::closeConn ( int  compId)
virtual

Close the connection with the given component ID.

virtual int DtRtiAssistantServer::currentCompId ( ) const
virtual

Returns the component ID from which the current message being processed was received, or -1 if there is no such message.

virtual void DtRtiAssistantServer::forwardMsg ( const DtAssistantMsg msg)
virtual

Forwards a message from a remote assistant to the local component that is its final destination.

virtual const DtInetAddr& DtRtiAssistantServer::getNetworkAddr ( )
virtual
bool DtRtiAssistantServer::isOk ( ) const

Returns true if the server was successfully started.

virtual DtU32 DtRtiAssistantServer::maxMsgSize ( ) const
virtual

Gets the maximum message size.

virtual DtAssistantMessageFactory* DtRtiAssistantServer::msgFactory ( ) const
protectedvirtual
virtual std::auto_ptr<DtAssistantMsg> DtRtiAssistantServer::netRead ( DtTcpMsgSocket sock,
int *  retCode 
) const
protectedvirtual

Read a message from a socket.

virtual unsigned int DtRtiAssistantServer::numConnections ( ) const
virtual

Return the number of current RTI component connections.

DtRtiAssistantServer& DtRtiAssistantServer::operator= ( const DtRtiAssistantServer )
private
virtual int DtRtiAssistantServer::port ( ) const
virtual

Returns the Assistant server port.

virtual bool DtRtiAssistantServer::readAndProcess ( DtTime  maxTimePerSocket)
protectedvirtual

Make a single pass over the socket list allocating up to max.

time per socket to each.

virtual void DtRtiAssistantServer::removeMsgCallback ( DtAssistantMsgKind  msgKind,
DtAssistantMsgCbMgr::DtCallbackFcn  fcn,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::removeSocketAdditionCallback ( DtAssistantSocketAdditionCb  cb,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::removeSocketRemovalCallback ( DtAssistantSocketRemovalCb  cb,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::removeWildcardMsgCallback ( DtAssistantMsgCbMgr::DtCallbackFcn  fcn,
void *  usr 
)
virtual
virtual void DtRtiAssistantServer::sendAssistantCommandResponseMsg ( int  compId,
const MAKRti::DtString &  formattedData 
)
virtual

Sends a response to an assistant command message.

virtual void DtRtiAssistantServer::sendBroadcast ( const DtAssistantMsg msg)
virtual

Send the message over the all connections.

virtual void DtRtiAssistantServer::sendConnMsg ( int  compId,
bool  disconnect = false,
const MAKRti::DtString &  display = MAKRti::DtString::nullString() 
)
virtual

Sends a component ID back to a connecting component.

virtual void DtRtiAssistantServer::sendConnRespMsg ( int  compId,
const DtRtiConnectionInfoDataPair conn,
const DtRtiConnectionConfigurationInfo config,
bool  accepted 
)
virtual

Sends a connection query response message.

Requires the RID path to be set in the config (if RID is a user configuration).

virtual void DtRtiAssistantServer::sendDeleteFederateMsg ( int  compId,
DtU16  fedexHandle,
DtU16  fedHandle 
)
virtual

Sends a message to tell an rtiexec that it shold delete a federate.

virtual void DtRtiAssistantServer::sendDoNotWaitForForwardersMsg ( int  compId)
virtual

Sends a message to the specified forwarder telling it to proceed without waiting for any more forwarders to connect.

virtual void DtRtiAssistantServer::sendExitMsg ( int  compId = -1)
virtual

Sends an exit command message for the specified component, or for all components if none specified.

virtual void DtRtiAssistantServer::sendFederateResignMsg ( int  compId,
int  federationHdl,
int  federateHdl 
)
virtual

Sends a force federate resign message to an rtiexec.

virtual void DtRtiAssistantServer::sendFederationDestroyMsg ( int  compId,
int  federationHdl 
)
virtual

Sends a force federation destroy message to an rtiexec.

virtual void DtRtiAssistantServer::sendForwarderConnectMsg ( int  compId,
const MAKRti::DtString &  targetHost,
const MAKRti::DtInetAddr &  targetAddress,
int  targetPort 
)
virtual

Sends a connect to forwarder message to a forwarder component.

virtual void DtRtiAssistantServer::sendLatencyTestRequestMsg ( int  compId,
bool  runTest,
bool  continuous,
bool  shouldHalt,
bool  observing,
unsigned int  interactionPeriod,
unsigned int  numInteractions,
unsigned int  payloadBytes,
unsigned long  federationHandle = 0,
unsigned long  initFedHandle = 0 
)
virtual

Sends an initiate latency test request message.

Federation and initiating federate handles are only needed when recipient is an rtiexec.

virtual void DtRtiAssistantServer::sendLicRespMsg ( int  compId,
bool  runUnlicensed,
const MAKRti::DtString &  server,
int  port,
bool  accepted 
)
virtual

Sends a license query response message.

virtual void DtRtiAssistantServer::sendLogEnableMsg ( int  compId,
bool  enable 
)
virtual

Sends a logging enable message.

virtual void DtRtiAssistantServer::sendLogRequestMsg ( int  compId,
unsigned  maxLogSize 
)
virtual

Sends a log request to an rtiexec.

The response will contain either the entire rtiexec log, or at most recent maxLogSize bytes.

virtual void DtRtiAssistantServer::sendMsg ( DtTcpMsgSocket sock,
const DtAssistantMsg msg 
)
protectedvirtual

Sends the message over the specified socket.

virtual void DtRtiAssistantServer::sendMsgOnConn ( int  compId,
const DtAssistantMsg msg 
)
virtual

Send the message over the specified connection.

virtual void DtRtiAssistantServer::sendNetStatsObservationRequestMsg ( DtAssistantObservationType  observationType,
int  compId,
bool  observe = false,
unsigned int  interval = 0 
)
virtual

Sends a Observation Request to an local component.

It will either request that it observe and interval the federate should send, or tell the federate not observing.

virtual void DtRtiAssistantServer::sendNetworkTestEnableMsg ( int  compId,
int  federationHdl,
bool  enable 
)
virtual

Sends a message enabling or disabling network testing for the given federation.

virtual void DtRtiAssistantServer::sendNtfyLvlUpdateMsg ( int  compId,
DtNotifyLevelType  notifyLevel 
)
virtual

Sends a notify level update message.

virtual void DtRtiAssistantServer::sendObserveRtiexecLogMsg ( int  connId,
bool  isObserved 
)
virtual

Sends a message to tell an rtiexec that it should either start or stop sending its log information.

virtual void DtRtiAssistantServer::sendObserveRtiexecMsg ( int  compId,
bool  isObserved,
unsigned int  timeStateIntervalMs 
)
virtual

Sends a message to tell an rtiexec that it should either start or stop sending its information.

virtual void DtRtiAssistantServer::sendObserveRtiForwarderMsg ( int  compId,
bool  isObserved,
unsigned int  timeStateIntervalMs,
int  defunctRemovalTime 
)
virtual

Sends a message to tell an RTI Forwarder that it should either start or stop sending its information.

virtual void DtRtiAssistantServer::sendRidParamsRequestMsg ( int  compId)
virtual

Sends a RID parameter request to an rtiexec.

virtual void DtRtiAssistantServer::sendSignalTickIntervalMsg ( int  compId,
float  signalTickInterval 
)
virtual

sends the signal tick interval

virtual void DtRtiAssistantServer::sendSingleObserveForwarderMsg ( int  compId)
virtual

Sends a message to tell a local forwarder that it should send its data one time only.

virtual void DtRtiAssistantServer::sendSingleObserveRtiExecMsg ( int  compId)
virtual

Sends a message to tell a local rtiExec that it should send its data one time only.

virtual void DtRtiAssistantServer::setMsgFactory ( DtAssistantMessageFactory fact)
protectedvirtual

Get/Set the message factory .

static void DtRtiAssistantServer::tcpSocketAdditionCb ( DtTcpMsgSocket sock,
void *  usr 
)
static

Callbacks on addition/removal of TCP sockets.

virtual void DtRtiAssistantServer::tcpSocketAdditionCb ( DtTcpMsgSocket sock)
protectedvirtual

Callbacks on addition/removal of TCP sockets.

static void DtRtiAssistantServer::tcpSocketRemovalCb ( DtTcpMsgSocket sock,
void *  usr 
)
static
virtual void DtRtiAssistantServer::tcpSocketRemovalCb ( DtTcpMsgSocket sock)
protectedvirtual
virtual void DtRtiAssistantServer::testConnections ( )
protectedvirtual

Verify connection status and mark bad connections for removal.

virtual bool DtRtiAssistantServer::tick ( double  timeout = 0)
virtual

Do the actual message processing.

  • RTI connections are treated as synchronous in main thread.

Member Data Documentation

DtAssistantSocketAdditionCallbackList DtRtiAssistantServer::myAdditionCallbacks
protected

Lists of pointers to socket addition and socket removal callbacks.

DtClock DtRtiAssistantServer::myClock
protected

Clock for timeouts.

CompIdToSocketMap DtRtiAssistantServer::myConnectionsById
protected

Map of connections by component ID.

DtTime DtRtiAssistantServer::myConnTestInterval
protected

Interval at which connections should be tested.

DtTcpMsgSocket* DtRtiAssistantServer::myCurrentSocket
protected

The socket on which the current message being processed was received.

Responses to this message should use this socket.

DtAssistantDfltMsgFactory DtRtiAssistantServer::myDefaultMessageFactory
protected

Default message factory.

std::map<int, MAKRti::DtString> DtRtiAssistantServer::myDisconnectReasons
protected

List of reasons for socket disconnects.

SocketToCompIdMap DtRtiAssistantServer::myIdsByConnection
protected

Map of component IDs by connection.

DtAssistantMessageFactory* DtRtiAssistantServer::myMessageFactory
protected

The message factory.

DtAssistantMsgCbMgr DtRtiAssistantServer::myMsgCbMgr
protected

Message callback manager.

MAKRti::DtInetAddr DtRtiAssistantServer::myNetworkInterface
protected

Network Interface.

int DtRtiAssistantServer::myNextCompId
protected

Next component ID to use.

unsigned DtRtiAssistantServer::myNumMsgsReceived
protected

Total messages received.

unsigned DtRtiAssistantServer::myNumMsgsSent
protected

Total messages sent.

unsigned int DtRtiAssistantServer::myPort
protected

Port to which RTI components may connect.

DtAssistantSocketRemovalCallbackList DtRtiAssistantServer::myRemovalCallbacks
protected
std::auto_ptr<DtTcpMsgSocketMgr> DtRtiAssistantServer::mySocketMgr
protected

Manager for the sockets.

std::list< DtTcpMsgSocket* > DtRtiAssistantServer::mySocketsToDisconnect
protected

List of sockets to be disconnected before next read.

DtTime DtRtiAssistantServer::myTimeToTestConnections
protected

Next time to test connections.


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

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)