7#include <unordered_map>
11class FramedTransportTest;
20 using HeaderMap = std::unordered_map<std::string, std::string>;
35 static void FrameMessage(std::ostream &output,
const std::string &message);
47 static auto ReadContent(std::istream &input, std::size_t content_length)
68 static auto ParseContentLength(
const std::string &header_value) -> int;
Base class for framed transport mechanisms.
static constexpr const char * kHeaderDelimiter
The delimiter used to separate headers from the message content.
static auto ReadContentLengthFromStream(std::istream &input) -> int
static auto ReceiveFramedMessage(std::istream &input) -> std::string
Receives a framed message.
static auto ReadContent(std::istream &input, std::size_t content_length) -> std::string
Reads content from the input stream based on the content length.
friend class FramedTransportTest
static auto ReadHeadersFromStream(std::istream &input) -> HeaderMap
static void FrameMessage(std::ostream &output, const std::string &message)
Constructs a framed message.