Kea 3.0.0
isc::tcp::TcpStreamResponse Class Reference

Implements a simple length:data output stream message. More...

#include <tcp_stream_msg.h>

Inheritance diagram for isc::tcp::TcpStreamResponse:

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ TcpStreamResponse()

isc::tcp::TcpStreamResponse::TcpStreamResponse ( )
inline

Constructor.

Definition at line 102 of file tcp_stream_msg.h.

◆ ~TcpStreamResponse()

virtual isc::tcp::TcpStreamResponse::~TcpStreamResponse ( )
inlinevirtual

Destructor.

Definition at line 105 of file tcp_stream_msg.h.

Member Function Documentation

◆ appendResponseData() [1/2]

void isc::tcp::TcpStreamResponse::appendResponseData ( const std::string & str)
virtual

Appends a string to the response content.

Parameters
strcontents to add to the output buffer.

Definition at line 112 of file tcp_stream_msg.cc.

◆ appendResponseData() [2/2]

void isc::tcp::TcpStreamResponse::appendResponseData ( const uint8_t * data,
size_t length )
virtual

Appends a data to the response content.

Parameters
dataData to append to the response.
lengthLength of the contents to add.

Definition at line 102 of file tcp_stream_msg.cc.

◆ getResponseString()

std::string isc::tcp::TcpStreamResponse::getResponseString ( ) const
inline

Fetches the unpacked response as a string.

Returns
String containing the unpacked contents.

Definition at line 135 of file tcp_stream_msg.h.

◆ pack()

void isc::tcp::TcpStreamResponse::pack ( )
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_.

◆ setResponseData() [1/2]

void isc::tcp::TcpStreamResponse::setResponseData ( const std::string & str)
virtual

Replaces the response content from a string.

Parameters
strNew contents for the output buffer.

Definition at line 107 of file tcp_stream_msg.cc.

◆ setResponseData() [2/2]

void isc::tcp::TcpStreamResponse::setResponseData ( const uint8_t * data,
size_t length )
virtual

Replaces the response content .

Parameters
dataNew contents for the output buffer.
lengthLength of the contents to add.

Definition at line 97 of file tcp_stream_msg.cc.


The documentation for this class was generated from the following files: