![]() |
MAK RTIspy API Documentation for HLA 1516
|
The DtTcpRtiConnectionMgr is a concrete implementation of the DtWebSpyRtiConnectionMgr It is the RTI connection manager component of the web spy. More...
Inheritance diagram for DtTcpRtiConnectionMgr:
Collaboration diagram for DtTcpRtiConnectionMgr:Public Member Functions | |
| virtual | ~DtTcpRtiConnectionMgr () |
| Dtor. | |
| virtual bool | tick (unsigned int timeout=0) |
| Do the actual message processing. | |
| virtual unsigned int | numConnections () const |
| Return the number of current RTI component connections. | |
| virtual void | postCommand (const DtWebSpyUtils::ConnectionIdentifier &connInfo, std::auto_ptr< DtRtiMsg > command) |
| Post the next command message from the HTTP server to the specified connection. | |
Static Public Member Functions | |
| static DtWebSpyRtiConnectionMgr * | create (DtWebSpyServer &parent) |
| Virtual constructor. | |
| 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 < DtTcpMsgSocket *, DtWebSpyUtils::ConnectionIdentifier > | SocketToConnIdMap |
| typedef std::map < DtWebSpyUtils::ConnectionIdentifier, DtTcpMsgSocket * > | ConnIdToSocketMap |
Protected Member Functions | |
| DtTcpRtiConnectionMgr (DtWebSpyServer &parent) | |
| Uses Virtual Constructor idiom. | |
| virtual void | testConnections () |
| Verify connection status and mark bad connections for removal. | |
| virtual bool | readAndForward (DtTime maxTimePerSocket) |
| Make a single pass over the socket list allocating upto max. time per socket to each. | |
| virtual void | tcpSocketAdditionCb (DtTcpMsgSocket *sock) |
| Callbacks on addition/removal of TCP sockets. | |
| virtual void | tcpSocketRemovalCb (DtTcpMsgSocket *sock) |
| virtual DtWebSpyUtils::ConnectionIdentifier | establishConnection (DtTcpMsgSocket *sock) |
| Initialize new connection using the connection handshake protocol, returns the connection identifier for the connection. | |
| virtual std::auto_ptr< DtRtiMsg > | netRead (DtTcpMsgSocket *sock, int *retCode) const |
| Read a messagae from a socket. | |
Protected Attributes | |
| SocketToConnIdMap | myIdsByConnection |
| ConnIdToSocketMap | myConnectionsById |
| MAKRti::DtTime | myTimeToTestConnections |
| std::auto_ptr< DtTcpMsgSocketMgr > | mySocketMgr |
Private Member Functions | |
| DtTcpRtiConnectionMgr (const DtTcpRtiConnectionMgr &) | |
| Copy and Assignment unimplemented. | |
| DtTcpRtiConnectionMgr & | operator= (DtTcpRtiConnectionMgr &) |
| Copy and Assignment unimplmented. | |
The DtTcpRtiConnectionMgr is a concrete implementation of the DtWebSpyRtiConnectionMgr It is the RTI connection manager component of the web spy.
It handles all connections between the web server and the RTI components using TCP sockets.
typedef std::map< DtWebSpyUtils::ConnectionIdentifier, DtTcpMsgSocket* > DtTcpRtiConnectionMgr::ConnIdToSocketMap [protected] |
typedef std::map< DtTcpMsgSocket*, DtWebSpyUtils::ConnectionIdentifier > DtTcpRtiConnectionMgr::SocketToConnIdMap [protected] |
| DtTcpRtiConnectionMgr::DtTcpRtiConnectionMgr | ( | const DtTcpRtiConnectionMgr & | ) | [private] |
Copy and Assignment unimplemented.
Referenced by create().
| DtTcpRtiConnectionMgr::~DtTcpRtiConnectionMgr | ( | ) | [virtual] |
Dtor.
| DtTcpRtiConnectionMgr::DtTcpRtiConnectionMgr | ( | DtWebSpyServer & | parent | ) | [protected] |
Uses Virtual Constructor idiom.
References DtWebSpyRtiConnectionMgr::myRtiPort, mySocketMgr, DtWebSpyServer::params(), tcpSocketAdditionCb(), and tcpSocketRemovalCb().
| DtWebSpyRtiConnectionMgr * DtTcpRtiConnectionMgr::create | ( | DtWebSpyServer & | parent | ) | [static] |
Virtual constructor.
Reimplemented from DtWebSpyRtiConnectionMgr.
References DtTcpRtiConnectionMgr(), and lm.
| DtWebSpyUtils::ConnectionIdentifier DtTcpRtiConnectionMgr::establishConnection | ( | DtTcpMsgSocket * | sock | ) | [protected, virtual] |
Initialize new connection using the connection handshake protocol, returns the connection identifier for the connection.
Returns the connection type if handshake succeeds or DtUnknownConnectionType if it fails
References DtWwwControlMsg::command(), DtWwwControlMsg::commandId(), DtWwwControlMsg::connectionId(), DtWebSpyRtiConnectionMgr::createDescription(), DtTcpMsgSocket::destination(), DtConnectMsgKind, DtCreateExternalRtiMsg(), DtNET_READ_NO_PACKETS, DtWebSpyUtils::DtRtiExecConnection, DtWebSpyUtils::DtUnknownConnectionType, DtWwwControlMsgKind, DtTcpMsgSocket::isConnected(), DtRtiMsg::kindToString(), DtRtiMsg::msgKind(), DtWebSpyRtiConnectionMgr::myClock, DtWebSpyRtiConnectionMgr::myParent, netRead(), DtWebSpyServer::params(), DtRIDParameters::responseInterval, DtTcpMsgSocket::sendMessage(), DtConnectMsg::setConnectionHandle(), DtRtiMsg::setFederateHandle(), DtRtiMsg::setFedEx(), DtRIDParameters::tcpPort, and DtRIDParameters::webserviceEnableForwarding.
Referenced by tcpSocketAdditionCb().
| std::auto_ptr< DtRtiMsg > DtTcpRtiConnectionMgr::netRead | ( | DtTcpMsgSocket * | sock, |
| int * | retCode | ||
| ) | const [protected, virtual] |
Read a messagae from a socket.
References DtCreateExternalRtiMsg(), DtNET_BUFFER_TOO_SMALL, DtNET_READ_BAD_PACKET, DtNET_READ_FILTERED_PACKET, DtNET_READ_NO_PACKETS, DtNET_READ_SIZE_MISMATCH, DtNET_READ_SUCCESS, DtNET_UNKNOWN_ERROR, DtRtiMsg::kindToString(), MSG_STATUS_OK, DtTcpMsgSocket::recvMessage(), and DtRtiMsg::status().
Referenced by establishConnection(), and readAndForward().
| unsigned int DtTcpRtiConnectionMgr::numConnections | ( | ) | const [virtual] |
Return the number of current RTI component connections.
Implements DtWebSpyRtiConnectionMgr.
References myIdsByConnection.
| DtTcpRtiConnectionMgr& DtTcpRtiConnectionMgr::operator= | ( | DtTcpRtiConnectionMgr & | ) | [private] |
Copy and Assignment unimplmented.
| void DtTcpRtiConnectionMgr::postCommand | ( | const DtWebSpyUtils::ConnectionIdentifier & | connInfo, |
| std::auto_ptr< DtRtiMsg > | command | ||
| ) | [virtual] |
Post the next command message from the HTTP server to the specified connection.
Implements DtWebSpyRtiConnectionMgr.
References myConnectionsById, and DtTcpMsgSocket::sendMessage().
| bool DtTcpRtiConnectionMgr::readAndForward | ( | DtTime | maxTimePerSocket | ) | [protected, virtual] |
Make a single pass over the socket list allocating upto max. time per socket to each.
References DtNET_READ_SUCCESS, DtTcpMsgSocket::isConnected(), DtWebSpyRtiConnectionMgr::myClock, myIdsByConnection, DtWebSpyRtiConnectionMgr::myParent, mySocketMgr, netRead(), and DtWebSpyServer::postRtiResponse().
Referenced by tick().
| void DtTcpRtiConnectionMgr::tcpSocketAdditionCb | ( | DtTcpMsgSocket * | sock, |
| void * | usr | ||
| ) | [static] |
Callbacks on addition/removal of TCP sockets.
Referenced by DtTcpRtiConnectionMgr().
| void DtTcpRtiConnectionMgr::tcpSocketAdditionCb | ( | DtTcpMsgSocket * | sock | ) | [protected, virtual] |
Callbacks on addition/removal of TCP sockets.
References DtWebSpyServer::addConnection(), DtWebSpyUtils::DtRtiExecConnection, DtWebSpyUtils::DtUnknownConnectionType, establishConnection(), myConnectionsById, myIdsByConnection, DtWebSpyRtiConnectionMgr::myParent, mySocketMgr, and DtWebSpyUtils::ConnectionIdentifier::type().
| void DtTcpRtiConnectionMgr::tcpSocketRemovalCb | ( | DtTcpMsgSocket * | sock, |
| void * | usr | ||
| ) | [static] |
Referenced by DtTcpRtiConnectionMgr().
| void DtTcpRtiConnectionMgr::tcpSocketRemovalCb | ( | DtTcpMsgSocket * | sock | ) | [protected, virtual] |
| void DtTcpRtiConnectionMgr::testConnections | ( | ) | [protected, virtual] |
Verify connection status and mark bad connections for removal.
References mySocketMgr, and DtTcpMsgSocket::testConnectionStatus().
Referenced by tick().
| bool DtTcpRtiConnectionMgr::tick | ( | unsigned int | timeout = 0 | ) | [virtual] |
Do the actual message processing.
Implements DtWebSpyRtiConnectionMgr.
References DtWebSpyRtiConnectionMgr::myClock, DtWebSpyRtiConnectionMgr::myParent, mySocketMgr, myTimeToTestConnections, DtWebSpyServer::params(), readAndForward(), and testConnections().
Referenced by postCommand(), tcpSocketAdditionCb(), and tcpSocketRemovalCb().
Referenced by numConnections(), readAndForward(), tcpSocketAdditionCb(), and tcpSocketRemovalCb().
std::auto_ptr<DtTcpMsgSocketMgr> DtTcpRtiConnectionMgr::mySocketMgr [protected] |
Referenced by DtTcpRtiConnectionMgr(), readAndForward(), tcpSocketAdditionCb(), testConnections(), and tick().
MAKRti::DtTime DtTcpRtiConnectionMgr::myTimeToTestConnections [protected] |
Referenced by tick().