![]() |
MAK RTIspy API Documentation for HLA 1.3
|
The DtMsgSocket provides a wrapper around the DtInetSocket class to operate on messages rather than just raw data. More...
Inheritance diagram for DtMsgSocket:
Collaboration diagram for DtMsgSocket:Public Member Functions | |
| DtMsgSocket (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor. | |
| DtMsgSocket (std::auto_ptr< DtInetSocket > socket, DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor which takes a pre-created DtInetSocket pointer. | |
| virtual | ~DtMsgSocket () |
| Destructor. | |
| virtual int | sendMessage (caddr_t msg, size_t msgSize, bool deleteAfterSend, const DtInetAddr &destAddr=DtInetAddr::inaddrAny())=0 |
| Sends a message. | |
| virtual bool | flush ()=0 |
| Attempts to send any queued messages and bundled messages. | |
| virtual int | recvMessage (caddr_t *buffptr)=0 |
| Gets the next message from the incoming data. | |
| virtual int | recvMessageWithSrc (caddr_t *buffptr, DtInetEndpoint &src)=0 |
| Gets the next message from the stream of incoming data and sets the source of the message. | |
| virtual bool | closeSocket () |
| Close a socket. Returns true on successful close or false on failure. | |
| virtual DtInetSockState | state () const |
| Returns the state of the socket. | |
| const DtString & | lastError () const |
| Returns a description of the last error. | |
| virtual void | enableBundling (size_t maxBundleSize)=0 |
| Enables message bundling and sets the maximum bundle size. | |
| virtual void | disableBundling ()=0 |
| Disables message bundling. | |
| virtual void | enableCompression (DtU8 compressionLevel)=0 |
| Enables message compression and sets the compression level. | |
| virtual void | disableCompression ()=0 |
| Disables message compression. | |
| const DtInetEndpoint & | localEndpoint () const |
| Gets the local endpoint for the socket. | |
| void | setSendBufferSize (DtU32 size) |
| Sets the socket send buffer size. | |
| void | setRecvBufferSize (DtU32 size) |
| Sets the socket receive buffer size. | |
| DtU32 | maxSendMsgSize () const |
| Gets the maximum socket send size. | |
| int | descriptor () const |
| Get's the socket file descriptor. | |
| DtInetSocket * | inetSocket () |
| Returns a pointer to the DtInetSocket. | |
Protected Member Functions | |
| void | expandRecvBuffer (size_t sizeNeeded) |
| Expands the receive buffer to accommodate the given size message. | |
Protected Attributes | |
| std::auto_ptr < MAKRti::DtInetSocket > | mySocket |
| The socket. | |
| DtInetBuffer | myRecvBuffer |
| The buffer to store received data in. | |
| DtString | myLastError |
| Description of last error. | |
| DtBoost::shared_ptr < DtMsgHeaderReader > | myHeaderReader |
| Reads data from message header. | |
Private Member Functions | |
| DtMsgSocket (const DtMsgSocket &) | |
| Not copyable. | |
| DtMsgSocket & | operator= (const DtMsgSocket &) |
The DtMsgSocket provides a wrapper around the DtInetSocket class to operate on messages rather than just raw data.
| DtMsgSocket::DtMsgSocket | ( | DtBoost::shared_ptr< DtMsgHeaderReader > | hdrReader, |
| size_t | recvBuffSize | ||
| ) |
Constructor.
Requires a header reader to extract information from message headers.
| DtMsgSocket::DtMsgSocket | ( | std::auto_ptr< DtInetSocket > | socket, |
| DtBoost::shared_ptr< DtMsgHeaderReader > | hdrReader, | ||
| size_t | recvBuffSize | ||
| ) |
Constructor which takes a pre-created DtInetSocket pointer.
Gives ownership and responsibility of the socket to the DtMsgSocket object.
| DtMsgSocket::~DtMsgSocket | ( | ) | [virtual] |
Destructor.
| DtMsgSocket::DtMsgSocket | ( | const DtMsgSocket & | ) | [private] |
Not copyable.
| bool DtMsgSocket::closeSocket | ( | ) | [virtual] |
Close a socket. Returns true on successful close or false on failure.
References mySocket.
| int DtMsgSocket::descriptor | ( | ) | const [inline] |
Get's the socket file descriptor.
Referenced by DtConnectionMgr::readFileDescriptor(), DtRtiMsgForwarder::removeOldConnection(), DtExtendedRtiMsgForwarder::selectParams(), DtExtendedRtiMsgForwarder::tcpSocketAdditionCb(), DtRtiMsgForwarder::tcpSocketAdditionCb(), DtExtendedRtiMsgForwarder::tcpSocketRemovalCb(), DtRtiMsgForwarder::tcpSocketRemovalCb(), DtRtiMsgForwarder::waitForIo(), and DtAsyncConnectionMgr::workerThread().
| virtual void DtMsgSocket::disableBundling | ( | ) | [pure virtual] |
Disables message bundling.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
| virtual void DtMsgSocket::disableCompression | ( | ) | [pure virtual] |
Disables message compression.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
| virtual void DtMsgSocket::enableBundling | ( | size_t | maxBundleSize | ) | [pure virtual] |
Enables message bundling and sets the maximum bundle size.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
| virtual void DtMsgSocket::enableCompression | ( | DtU8 | compressionLevel | ) | [pure virtual] |
Enables message compression and sets the compression level.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
| void DtMsgSocket::expandRecvBuffer | ( | size_t | sizeNeeded | ) | [inline, protected] |
Expands the receive buffer to accommodate the given size message.
Referenced by DtTcpMsgSocket::recvMessage().
| virtual bool DtMsgSocket::flush | ( | ) | [pure virtual] |
Attempts to send any queued messages and bundled messages.
Returns true if all queued and bundled messages were sent.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, DtUdpMsgSocket, and DtRtiSmSocket.
Referenced by DtRtiConnection::flush(), and DtConnectionMgr::flush().
| DtInetSocket * DtMsgSocket::inetSocket | ( | ) | [inline] |
Returns a pointer to the DtInetSocket.
Referenced by DtTcpMsgSocketMgr::removeAndDelete().
| const DtString & DtMsgSocket::lastError | ( | ) | const [inline] |
Returns a description of the last error.
Referenced by DtRtiConnection::flush(), DtRtiConnection::netRead(), and DtRtiConnection::send().
| const DtInetEndpoint& DtMsgSocket::localEndpoint | ( | ) | const [inline] |
Gets the local endpoint for the socket.
Referenced by DtExtendedRtiMsgForwarder::init(), and DtInOutForwarderPort::sendPortMsg().
| DtU32 DtMsgSocket::maxSendMsgSize | ( | ) | const [inline] |
Gets the maximum socket send size.
Referenced by DtRtiAssistantExecClient::sendLogMsg().
| DtMsgSocket& DtMsgSocket::operator= | ( | const DtMsgSocket & | ) | [private] |
| virtual int DtMsgSocket::recvMessage | ( | caddr_t * | buffptr | ) | [pure virtual] |
Gets the next message from the incoming data.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
Referenced by DtRtiConnection::netRead().
| virtual int DtMsgSocket::recvMessageWithSrc | ( | caddr_t * | buffptr, |
| DtInetEndpoint & | src | ||
| ) | [pure virtual] |
Gets the next message from the stream of incoming data and sets the source of the message.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
Referenced by DtInOutForwarderPort::getInitializationMsg().
| virtual int DtMsgSocket::sendMessage | ( | caddr_t | msg, |
| size_t | msgSize, | ||
| bool | deleteAfterSend, | ||
| const DtInetAddr & | destAddr = DtInetAddr::inaddrAny() |
||
| ) | [pure virtual] |
Sends a message.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
Referenced by DtRtiConnection::send().
| void DtMsgSocket::setRecvBufferSize | ( | DtU32 | size | ) | [inline] |
Sets the socket receive buffer size.
Referenced by DtPeerToPeerTcpSockMgr::connectToPeer(), DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::createBestEffortConn(), DtConnectionMgr::createRelConn(), DtMulitcastDiscoveryMgr::init(), DtExtendedRtiMsgForwarder::init(), DtInOutForwarderPort::initializeConnections(), DtTcpMsgSocketMgr::socketAdded(), and DtConnectionMgr::updateBufferSizes().
| void DtMsgSocket::setSendBufferSize | ( | DtU32 | size | ) | [inline] |
Sets the socket send buffer size.
Referenced by DtPeerToPeerTcpSockMgr::connectToPeer(), DtConnectionMgr::createAncillaryRelConns(), DtConnectionMgr::createBestEffortConn(), DtConnectionMgr::createRelConn(), DtMulitcastDiscoveryMgr::init(), DtExtendedRtiMsgForwarder::init(), DtTcpMsgSocketMgr::socketAdded(), and DtConnectionMgr::updateBufferSizes().
| DtInetSockState DtMsgSocket::state | ( | ) | const [inline, virtual] |
Returns the state of the socket.
Reimplemented in DtRtiSmSocket.
Referenced by DtRtiConnection::init(), and DtRtiConnection::isOk().
DtBoost::shared_ptr<DtMsgHeaderReader> DtMsgSocket::myHeaderReader [protected] |
Reads data from message header.
Referenced by DtTcpMsgSocket::recvMessage(), DtTcpMsgSocket::resizeTestPacket(), and DtUdpMsgSocket::sendMessage().
DtString DtMsgSocket::myLastError [protected] |
Description of last error.
Referenced by DtTcpMsgSocket::openClientSocket(), DtTcpMsgSocket::openServerSocket(), DtUdpMsgSocket::openSocket(), DtTcpMsgSocket::queueMessage(), DtUdpMsgSocket::recv(), DtTcpMsgSocket::recvMessage(), DtTcpMsgSocket::sendData(), DtUdpMsgSocket::sendMessage(), and DtTcpMsgSocket::sendMessage().
DtInetBuffer DtMsgSocket::myRecvBuffer [protected] |
The buffer to store received data in.
Referenced by DtSmSocket__rti__::recv(), DtRtiSmSocket::recv(), DtUdpMsgSocket::recv(), and DtTcpMsgSocket::recvMessage().
std::auto_ptr<MAKRti::DtInetSocket> DtMsgSocket::mySocket [protected] |
The socket.
Referenced by closeSocket(), DtTcpMsgSocket::destination(), DtUdpMsgSocket::flush(), DtTcpMsgSocket::flushQueue(), DtFederateTrackingFilter::handleJoinConfirmMsg(), DtUdpMsgSocket::isOpen(), DtUdpMsgSocket::maxMsgSize(), DtTcpMsgSocket::maxMsgSize(), DtTcpMsgSocket::openClientSocket(), DtTcpMsgSocket::openServerSocket(), DtUdpMsgSocket::openSocket(), DtUdpMsgSocket::recv(), DtTcpMsgSocket::recvMessage(), DtTcpMsgSocket::recvMessageWithSrc(), DtUdpMsgSocket::retrySendTo(), DtTcpMsgSocket::sendData(), DtUdpMsgSocket::sendMessage(), DtTcpMsgSocket::sendMessage(), DtUdpMsgSocket::sendPacket(), DtTcpMsgSocket::setNonBlocking(), and DtTcpMsgSocket::setTcpNoDelay().