![]() |
MAK RTIspy API Documentation for HLA 1516
|
The DtMsgSocket provides a wrapper around the MAKRti::DtInetSocket class to operate on messages rather than just raw data. More...
Inheritance diagram for DtMsgSocket:
Collaboration diagram for DtMsgSocket:Public Member Functions | |
| DtMsgSocket (std::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor. More... | |
| DtMsgSocket (DtUniquePtr< MAKRti::DtInetSocket > socket, std::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor which takes a pre-created MAKRti::DtInetSocket pointer. More... | |
| virtual | ~DtMsgSocket () |
| Destructor. More... | |
| virtual int | sendMessage (caddr_t msg, size_t msgSize, bool deleteAfterSend, const MAKRti::DtInetAddr &destAddr=MAKRti::DtInetAddr::inaddrAny(), int port=0)=0 |
| Sends a message. More... | |
| virtual bool | flush ()=0 |
| Attempts to send any queued messages and bundled messages. More... | |
| virtual int | recvMessage (caddr_t *buffptr)=0 |
| Gets the next message from the incoming data. More... | |
| virtual int | recvMessageWithSrc (caddr_t *buffptr, MAKRti::DtInetEndpoint &src)=0 |
| Gets the next message from the stream of incoming data and sets the source of the message. More... | |
| virtual bool | closeSocket () |
| Close a socket. Returns true on successful close or false on failure. More... | |
| virtual MAKRti::DtInetSockState | state () const |
| Returns the state of the socket. More... | |
| void | printStateToStream (MAKRti::DtOutputStream &stream) const |
| prints state to stream More... | |
| const MAKRti::DtString & | lastError () const |
| Returns a description of the last error. More... | |
| virtual void | enableBundling (size_t maxBundleSize)=0 |
| Enables message bundling and sets the maximum bundle size. More... | |
| virtual void | disableBundling ()=0 |
| Disables message bundling. More... | |
| virtual void | enableCompression (MAKRti::DtU8 compressionLevel)=0 |
| Enables message compression and sets the compression level. More... | |
| virtual void | disableCompression ()=0 |
| Disables message compression. More... | |
| const MAKRti::DtInetEndpoint & | localEndpoint () const |
| Gets the local endpoint for the socket. More... | |
| void | setSendBufferSize (MAKRti::DtU32 size) |
| Sets the socket send buffer size. More... | |
| void | setRecvBufferSize (MAKRti::DtU32 size) |
| Sets the socket receive buffer size. More... | |
| MAKRti::DtU32 | maxSendMsgSize () const |
| Gets the maximum socket send size. More... | |
| unsigned int | descriptor () const |
| Get's the socket file descriptor. More... | |
| MAKRti::DtInetSocket * | inetSocket () |
| Returns a pointer to the MAKRti::DtInetSocket. More... | |
Protected Member Functions | |
| void | expandRecvBuffer (size_t sizeNeeded) |
| Expands the receive buffer to accommodate the given size message. More... | |
Protected Attributes | |
| DtUniquePtr< MAKRti::DtInetSocket > | mySocket |
| The socket. More... | |
| MAKRti::DtInetBuffer | myRecvBuffer |
| The buffer to store received data in. More... | |
| MAKRti::DtString | myLastError |
| Description of last error. More... | |
| std::shared_ptr < DtMsgHeaderReader > | myHeaderReader |
| Reads data from message header. More... | |
Private Member Functions | |
| DtMsgSocket (const DtMsgSocket &) | |
| Not copyable. More... | |
| DtMsgSocket & | operator= (const DtMsgSocket &) |
The DtMsgSocket provides a wrapper around the MAKRti::DtInetSocket class to operate on messages rather than just raw data.
| DtMsgSocket::DtMsgSocket | ( | std::shared_ptr< DtMsgHeaderReader > | hdrReader, |
| size_t | recvBuffSize | ||
| ) |
Constructor.
Requires a header reader to extract information from message headers.
| DtMsgSocket::DtMsgSocket | ( | DtUniquePtr< MAKRti::DtInetSocket > | socket, |
| std::shared_ptr< DtMsgHeaderReader > | hdrReader, | ||
| size_t | recvBuffSize | ||
| ) |
Constructor which takes a pre-created MAKRti::DtInetSocket pointer.
Gives ownership and responsibility of the socket to the DtMsgSocket object.
|
virtual |
Destructor.
|
private |
Not copyable.
|
virtual |
Close a socket. Returns true on successful close or false on failure.
|
inline |
Get's the socket file descriptor.
|
pure virtual |
Disables message bundling.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
|
pure virtual |
Disables message compression.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
|
pure virtual |
Enables message bundling and sets the maximum bundle size.
Implemented in DtTcpMsgSocket, DtSmSocket__rti__, and DtUdpMsgSocket.
|
pure virtual |
Enables message compression and sets the compression level.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
|
inlineprotected |
Expands the receive buffer to accommodate the given size message.
References myRecvBuffer.
|
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__, and DtUdpMsgSocket.
|
inline |
Returns a pointer to the MAKRti::DtInetSocket.
References mySocket.
|
inline |
Returns a description of the last error.
References myLastError.
Referenced by printStateToStream().
|
inline |
Gets the local endpoint for the socket.
|
inline |
Gets the maximum socket send size.
|
private |
|
inline |
prints state to stream
References lastError(), and state().
|
pure virtual |
Gets the next message from the incoming data.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
|
pure virtual |
Gets the next message from the stream of incoming data and sets the source of the message.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
|
pure virtual |
Sends a message.
Implemented in DtTcpMsgSocket, and DtUdpMsgSocket.
|
inline |
Sets the socket receive buffer size.
|
inline |
Sets the socket send buffer size.
|
inlinevirtual |
|
protected |
Reads data from message header.
|
protected |
Description of last error.
Referenced by lastError().
|
protected |
The buffer to store received data in.
Referenced by expandRecvBuffer().
|
protected |
The socket.
Referenced by inetSocket(), DtTcpMsgSocket::inetTcpSocket(), DtUdpMsgSocket::inetUdpSocket(), and state().