7#ifndef TCP_STREAM_MSG_H
8#define TCP_STREAM_MSG_H
11#include <boost/shared_ptr.hpp>
40 virtual size_t postBuffer(
const void* buf,
const size_t nbytes);
69 " - cannot access empty request");
88 size_t expected_size_;
136 return (std::string(response_.begin(), response_.end()));
141 std::vector<uint8_t> response_;
A generic exception that is thrown if a function is called in a prohibited way.
Abstract class used to receive an inbound message.
Abstract class used to create and send an outbound response.
Implement a simple length:data input stream message.
std::string getRequestString() const
Fetches the unpacked request as a string.
const uint8_t * getRequest() const
Returns pointer to the first byte of the unpacked request data.
virtual std::string logFormatRequest(const size_t limit=0) const
Returns request contents formatted for log output.
virtual void unpack()
Unpacks the wire data into a string request.
virtual size_t postBuffer(const void *buf, const size_t nbytes)
Adds data to an incomplete request.
virtual bool needData() const
Returns true if the request is incomplete.
TcpStreamRequest()
Constructor.
size_t getRequestSize() const
Returns size of the unpacked request.
std::vector< uint8_t > request_
Unpacked request content.
virtual ~TcpStreamRequest()
Destructor.
Implements a simple length:data output stream message.
virtual void appendResponseData(const uint8_t *data, size_t length)
Appends a data to the response content.
virtual ~TcpStreamResponse()
Destructor.
virtual void setResponseData(const uint8_t *data, size_t length)
Replaces 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.
TcpStreamResponse()
Constructor.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< TcpStreamResponse > TcpStreamResponsePtr
Pointer to a TcpStreamResponse.
boost::shared_ptr< TcpStreamRequest > TcpStreamRequestPtr
Pointer to a TcpStreamRequest.
Defines the logger used by the top-level component of kea-lfc.