![]() |
MAK RTIspy API Documentation for HLA 1.3
|
The DtTcpWwwSpyAdapter class provides the interface between any RTI component and the WebSpy server. More...
Inheritance diagram for DtTcpWwwSpyAdapter:
Collaboration diagram for DtTcpWwwSpyAdapter:Public Member Functions | |
| virtual | ~DtTcpWwwSpyAdapter () |
| Dtor. | |
| virtual DtRtiMsg * | getNextMsg () |
| Read a message from the web server (returns null if none pending) | |
| virtual void | postMsg (const DtRtiMsg &msg) |
| Post a response to the web server. | |
Static Public Member Functions | |
| static DtWwwSpyAdapter * | create (const DtRIDParameters ¶ms, DtWebSpyUtils::ConnectionType type, unsigned long connId) |
| Virtual constructor. | |
Protected Member Functions | |
| DtTcpWwwSpyAdapter (const DtRIDParameters ¶ms, DtWebSpyUtils::ConnectionType type, unsigned long connId) | |
| Ctor protected - use virtual ctor method. | |
| virtual bool | connectToWebServer () |
| Attempt to open a connection and handshake with the server Returns false if connection fails. | |
| virtual bool | startWebServer () |
| Attempt to start a new web server Return boolean: process started (not necessarily complete but at least the executable was there) | |
| virtual bool | getConnectMsg () |
| Wait for the server to send a connect msg in response to a new connection. | |
| virtual void | sendTypeInfo () |
| Send component type information to the server. | |
| DtRtiMsg * | netRead (int *retCode) const |
| Attempt to read a new message from the socket. | |
Protected Attributes | |
| MAKRti::DtInetAddr | myWebServerAddr |
| unsigned int | myWebServerPort |
| DtTcpMsgSocket * | mySocket |
Private Member Functions | |
| DtTcpWwwSpyAdapter (const DtTcpWwwSpyAdapter &) | |
| Copy and Assignment unimplemented. | |
| DtTcpWwwSpyAdapter & | operator= (DtTcpWwwSpyAdapter &) |
| Copy and Assignment unimplmented. | |
The DtTcpWwwSpyAdapter class provides the interface between any RTI component and the WebSpy server.
It is responsible for creating, connecting to, and communicating with the web server.
| DtTcpWwwSpyAdapter::DtTcpWwwSpyAdapter | ( | const DtTcpWwwSpyAdapter & | ) | [private] |
Copy and Assignment unimplemented.
Referenced by create().
| DtTcpWwwSpyAdapter::~DtTcpWwwSpyAdapter | ( | ) | [virtual] |
Dtor.
References mySocket.
| DtTcpWwwSpyAdapter::DtTcpWwwSpyAdapter | ( | const DtRIDParameters & | params, |
| DtWebSpyUtils::ConnectionType | type, | ||
| unsigned long | connId | ||
| ) | [protected] |
Ctor protected - use virtual ctor method.
| bool DtTcpWwwSpyAdapter::connectToWebServer | ( | ) | [protected, virtual] |
Attempt to open a connection and handshake with the server Returns false if connection fails.
Implements DtWwwSpyAdapter.
References getConnectMsg(), DtTcpMsgSocket::isConnected(), mySocket, myWebServerAddr, myWebServerPort, DtTcpMsgSocket::openClientSocket(), sendTypeInfo(), and DtTcpMsgSocket::setNonBlocking().
| DtWwwSpyAdapter * DtTcpWwwSpyAdapter::create | ( | const DtRIDParameters & | params, |
| DtWebSpyUtils::ConnectionType | type, | ||
| unsigned long | connId | ||
| ) | [static] |
Virtual constructor.
Reimplemented from DtWwwSpyAdapter.
References DtTcpWwwSpyAdapter(), and lm.
Referenced by DtForwarderWebManager::DtForwarderWebManager(), and DtRtiExecWebManager::DtRtiExecWebManager().
| bool DtTcpWwwSpyAdapter::getConnectMsg | ( | ) | [protected, virtual] |
Wait for the server to send a connect msg in response to a new connection.
References DtConnectMsgKind, DtRtiMsg::kindToString(), DtRtiMsg::msgKind(), DtWwwSpyAdapter::myClock, DtWwwSpyAdapter::myParams, netRead(), and DtRIDParameters::responseInterval.
Referenced by connectToWebServer().
| DtRtiMsg * DtTcpWwwSpyAdapter::getNextMsg | ( | ) | [virtual] |
Read a message from the web server (returns null if none pending)
Implements DtWwwSpyAdapter.
References DtTcpMsgSocket::isConnected(), DtWwwSpyAdapter::myConnectionStatus, mySocket, and netRead().
| DtRtiMsg * DtTcpWwwSpyAdapter::netRead | ( | int * | retCode | ) | const [protected] |
Attempt to read a new message from the socket.
References DtCreateExternalRtiMsg(), DtInvalidMsgKind, 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, DtRtiMessageVersion, DtRtiMsg::kindToString(), MSG_STATUS_OK, DtWwwSpyAdapter::myParams, mySocket, NULL, DtTcpMsgSocket::recvMessage(), and DtRtiMsg::status().
Referenced by getConnectMsg(), and getNextMsg().
| DtTcpWwwSpyAdapter& DtTcpWwwSpyAdapter::operator= | ( | DtTcpWwwSpyAdapter & | ) | [private] |
Copy and Assignment unimplmented.
| void DtTcpWwwSpyAdapter::postMsg | ( | const DtRtiMsg & | msg | ) | [virtual] |
Post a response to the web server.
Implements DtWwwSpyAdapter.
References DtTcpMsgSocket::isConnected(), DtWwwSpyAdapter::myConnectionStatus, mySocket, and DtTcpMsgSocket::sendMessage().
Referenced by sendTypeInfo().
| void DtTcpWwwSpyAdapter::sendTypeInfo | ( | ) | [protected, virtual] |
Send component type information to the server.
References DtCreateExternalRtiMsg(), DtWebSpyUtils::DtTypeInfoCntlMsg, DtWwwControlMsgKind, DtWwwSpyAdapter::myConnId, DtWwwSpyAdapter::myType, postMsg(), DtWwwControlMsg::setCommand(), DtWwwControlMsg::setCommandId(), DtWwwControlMsg::setConnectionId(), DtRtiMsg::setFedEx(), and DtWwwControlMsg::setTargetFederateHandle().
Referenced by connectToWebServer().
| bool DtTcpWwwSpyAdapter::startWebServer | ( | ) | [protected, virtual] |
Attempt to start a new web server Return boolean: process started (not necessarily complete but at least the executable was there)
Implements DtWwwSpyAdapter.
References DtRtiLibPath(), DtRIDParameters::getFullPathToRidFile(), DtWwwSpyAdapter::myParams, and DtWwwSpyAdapter::startWebServerProcess().
DtTcpMsgSocket* DtTcpWwwSpyAdapter::mySocket [protected] |
Referenced by connectToWebServer(), getNextMsg(), netRead(), postMsg(), and ~DtTcpWwwSpyAdapter().
MAKRti::DtInetAddr DtTcpWwwSpyAdapter::myWebServerAddr [protected] |
Referenced by connectToWebServer().
unsigned int DtTcpWwwSpyAdapter::myWebServerPort [protected] |
Referenced by connectToWebServer().