![]() |
Kea 3.0.0
|
Implements a simple length:data output stream message. More...
#include <tcp_stream_msg.h>
Public Member Functions | |
| TcpStreamResponse () | |
| Constructor. | |
| virtual | ~TcpStreamResponse () |
| Destructor. | |
| virtual void | appendResponseData (const std::string &str) |
| Appends a string to the response content. | |
| virtual void | appendResponseData (const uint8_t *data, size_t length) |
| Appends a data to the response content. | |
| std::string | getResponseString () const |
| Fetches the unpacked response as a string. | |
| virtual void | pack () |
| Packs the response content into wire data buffer. | |
| virtual void | setResponseData (const std::string &str) |
| Replaces the response content from a string. | |
| virtual void | setResponseData (const uint8_t *data, size_t length) |
| Replaces the response content . | |
| Public Member Functions inherited from isc::tcp::TcpResponse | |
| TcpResponse () | |
| Constructor. | |
| virtual | ~TcpResponse () |
| Destructor. | |
| virtual void | consumeWireData (const size_t length) |
| Erases n bytes from the beginning of the wire data. | |
| bool | sendInProgress () |
| bool | wireDataAvail () const |
| Checks if the output buffer contains some data to be sent. | |
| Public Member Functions inherited from isc::tcp::TcpMessage | |
| virtual | ~TcpMessage () |
| Destructor. | |
| const uint8_t * | getWireData () const |
| Returns pointer to the first byte of the wire data. | |
| size_t | getWireDataSize () const |
| Returns current size of the wire data. | |
Additional Inherited Members | |
| Protected Attributes inherited from isc::tcp::TcpMessage | |
| WireData | wire_data_ |
| Buffer used for data in wire format data. | |
Implements a simple length:data output stream message.
This class can be used to send a single message on a TCP stream where the message consists of a 16-bit unsigned length (in network order), followed by that number of bytes of data.
Definition at line 99 of file tcp_stream_msg.h.
|
inline |
Constructor.
Definition at line 102 of file tcp_stream_msg.h.
|
inlinevirtual |
Destructor.
Definition at line 105 of file tcp_stream_msg.h.
|
virtual |
Appends a string to the response content.
| str | contents to add to the output buffer. |
Definition at line 112 of file tcp_stream_msg.cc.
|
virtual |
Appends a data to the response content.
| data | Data to append to the response. |
| length | Length of the contents to add. |
Definition at line 102 of file tcp_stream_msg.cc.
|
inline |
Fetches the unpacked response as a string.
Definition at line 135 of file tcp_stream_msg.h.
|
virtual |
Packs the response content into wire data buffer.
Implements isc::tcp::TcpResponse.
Definition at line 117 of file tcp_stream_msg.cc.
References isc::tcp::TcpMessage::wire_data_.
|
virtual |
Replaces the response content from a string.
| str | New contents for the output buffer. |
Definition at line 107 of file tcp_stream_msg.cc.
|
virtual |
Replaces the response content .
| data | New contents for the output buffer. |
| length | Length of the contents to add. |
Definition at line 97 of file tcp_stream_msg.cc.