![]() |
MAK RTIspy API Documentation for HLA 1516
|
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 | 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 DtAssistantMessageFactory * | msgFactory () 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. | |
| DtAssistantMessageFactory * | myMessageFactory |
| The message factory. | |
| DtAssistantDfltMsgFactory | myDefaultMessageFactory |
| Default message factory. | |
| DtTcpMsgSocket * | myCurrentSocket |
| 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< DtTcpMsgSocketMgr > | mySocketMgr |
| 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. | |
| DtRtiAssistantServer & | operator= (const DtRtiAssistantServer &) |
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.
|
protected |
Maps of the connections and component IDs.
|
protected |
| DtRtiAssistantServer::DtRtiAssistantServer | ( | DtNotifyLevelType | level, |
| int | port = DtASSISTANT_DEFAULT_PORT, |
||
| const MAKRti::DtInetAddr & | networkInterface = MAKRti::DtInetAddr() |
||
| ) |
Constructor, networkInterface defaults to INADDR_ANY.
|
virtual |
Destructor.
|
private |
Copy and Assignment unimplemented.
|
virtual |
Message Callbacks These callback functions operate on all of the connections.
|
virtual |
These functions add callbacks for notification of the addition or removal of Assistant socket connections.
|
virtual |
|
virtual |
|
virtual |
Close the connection with the given component ID.
|
virtual |
Returns the component ID from which the current message being processed was received, or -1 if there is no such message.
|
virtual |
Forwards a message from a remote assistant to the local component that is its final destination.
|
virtual |
| bool DtRtiAssistantServer::isOk | ( | ) | const |
Returns true if the server was successfully started.
|
virtual |
Gets the maximum message size.
|
protectedvirtual |
|
protectedvirtual |
Read a message from a socket.
|
virtual |
Return the number of current RTI component connections.
|
private |
|
virtual |
Returns the Assistant server port.
|
protectedvirtual |
Make a single pass over the socket list allocating up to max.
time per socket to each.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sends a response to an assistant command message.
|
virtual |
Send the message over the all connections.
|
virtual |
Sends a component ID back to a connecting component.
|
virtual |
Sends a connection query response message.
|
virtual |
Sends a message to tell an rtiexec that it shold delete a federate.
|
virtual |
Sends a message to the specified forwarder telling it to proceed without waiting for any more forwarders to connect.
|
virtual |
Sends an exit command message for the specified component, or for all components if none specified.
|
virtual |
Sends a force federate resign message to an rtiexec.
|
virtual |
Sends a force federation destroy message to an rtiexec.
|
virtual |
Sends an initiate latency test request message.
Federation and initiating federate handles are only needed when recipient is an rtiexec.
|
virtual |
Sends a license query response message.
|
virtual |
Sends a logging enable message.
|
virtual |
Sends a log request to an rtiexec.
The response will contain either the entire rtiexec log, or at most recent maxLogSize bytes.
|
protectedvirtual |
Sends the message over the specified socket.
|
virtual |
Send the message over the specified connection.
|
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 |
Sends a message enabling or disabling network testing for the given federation.
|
virtual |
Sends a notify level update message.
|
virtual |
Sends a message to tell an rtiexec that it should either start or stop sending its log information.
|
virtual |
Sends a message to tell an rtiexec that it should either start or stop sending its information.
|
virtual |
Sends a message to tell an RTI Forwarder that it should either start or stop sending its information.
|
virtual |
Sends a RID parameter request to an rtiexec.
|
virtual |
sends the signal tick interval
|
virtual |
Sends a message to tell a local forwarder that it should send its data one time only.
|
virtual |
Sends a message to tell a local rtiExec that it should send its data one time only.
|
protectedvirtual |
Get/Set the message factory .
|
static |
Callbacks on addition/removal of TCP sockets.
|
protectedvirtual |
Callbacks on addition/removal of TCP sockets.
|
static |
|
protectedvirtual |
|
protectedvirtual |
Verify connection status and mark bad connections for removal.
|
virtual |
Do the actual message processing.
|
protected |
Lists of pointers to socket addition and socket removal callbacks.
|
protected |
Clock for timeouts.
|
protected |
Map of connections by component ID.
|
protected |
Interval at which connections should be tested.
|
protected |
The socket on which the current message being processed was received.
Responses to this message should use this socket.
|
protected |
Default message factory.
|
protected |
List of reasons for socket disconnects.
|
protected |
Map of component IDs by connection.
|
protected |
The message factory.
|
protected |
Message callback manager.
|
protected |
Network Interface.
|
protected |
Next component ID to use.
|
protected |
Total messages received.
|
protected |
Total messages sent.
|
protected |
Port to which RTI components may connect.
|
protected |
|
protected |
Manager for the sockets.
|
protected |
List of sockets to be disconnected before next read.
|
protected |
Next time to test connections.