|
| message (const con_msg_man_ptr manager) |
| Construct an empty message.
|
|
| message (const con_msg_man_ptr manager, frame::opcode::value op, size_t size=128) |
| Construct a message and fill in some values.
|
|
bool | get_prepared () const |
| Return whether or not the message has been prepared for sending.
|
|
void | set_prepared (bool value) |
| Set or clear the flag that indicates that the message has been prepared.
|
|
bool | get_compressed () const |
| Return whether or not the message is flagged as compressed.
|
|
void | set_compressed (bool value) |
| Set or clear the compression flag.
|
|
bool | get_terminal () const |
| Get whether or not the message is terminal.
|
|
void | set_terminal (bool value) |
| Set the terminal flag.
|
|
bool | get_fin () const |
| Read the fin bit.
|
|
void | set_fin (bool value) |
| Set the fin bit.
|
|
frame::opcode::value | get_opcode () const |
| Return the message opcode.
|
|
void | set_opcode (frame::opcode::value op) |
| Set the opcode.
|
|
std::string const & | get_header () const |
| Return the prepared frame header.
|
|
void | set_header (std::string const &header) |
| Set prepared frame header.
|
|
std::string const & | get_extension_data () const |
|
std::string const & | get_payload () const |
| Get a reference to the payload string.
|
|
std::string & | get_raw_payload () |
| Get a non-const reference to the payload string.
|
|
void | set_payload (std::string const &payload) |
| Set payload data.
|
|
void | set_payload (void const *payload, size_t len) |
| Set payload data.
|
|
void | append_payload (std::string const &payload) |
| Append payload data.
|
|
void | append_payload (void const *payload, size_t len) |
| Append payload data.
|
|
bool | recycle () |
| Recycle the message.
|
|
| message (con_msg_man_ptr manager, size_t size=128) |
|
frame::opcode::value | get_opcode () const |
|
const std::string & | get_header () const |
|
const std::string & | get_extension_data () const |
|
const std::string & | get_payload () const |
|
bool | recycle () |
| Recycle the message.
|
|
template<template< class > class con_msg_manager>
class websocketpp::message_buffer::message< con_msg_manager >
Represents a buffer for a single WebSocket message.
Definition at line 84 of file message.hpp.
template<template< class > class con_msg_manager>
Read the fin bit.
A message with the fin bit set will be sent as the last message of its sequence. A message with the fin bit cleared will require subsequent frames of opcode continuation until one of them has the fin bit set.
The remote end likely will not deliver any bytes until the frame with the fin bit set has been received.
- Returns
- Whether or not the fin bit is set
Definition at line 195 of file message.hpp.
template<template< class > class con_msg_manager>
Get whether or not the message is terminal.
Messages can be flagged as terminal, which results in the connection being close after they are written rather than the implementation going on to the next message in the queue. This is typically used internally for close messages only.
- Returns
- Whether or not this message is marked terminal
Definition at line 169 of file message.hpp.
template<template< class > class con_msg_manager>
Recycle the message.
A request to recycle this message was received. Forward that request to the connection message manager for processing. Errors and exceptions from the manager's recycle member function should be passed back up the call chain. The caller to message::recycle will deal with them.
Recycle must only be called by the message shared_ptr's destructor. Once recycled successfully, ownership of the memory has been passed to another system and must not be accessed again.
- Returns
- true if the message was successfully recycled, false otherwise.
Definition at line 316 of file message.hpp.
template<template< class > class con_msg_manager>
Recycle the message.
A request to recycle this message was received. Forward that request to the connection message manager for processing. Errors and exceptions from the manager's recycle member function should be passed back up the call chain. The caller to message::recycle will deal with them.
Recycle must only be called by the message shared_ptr's destructor. Once recycled successfully, ownership of the memory has been passed to another system and must not be accessed again.
- Returns
- true if the message was successfully recycled, false otherwise.
Definition at line 137 of file pool.hpp.
template<template< class > class con_msg_manager>
Set or clear the compression flag.
Setting the compression flag indicates that the data in this message would benefit from compression. If both endpoints negotiate a compression extension WebSocket++ will attempt to compress messages with this flag. Setting this flag does not guarantee that the message will be compressed.
- Parameters
-
value | The value to set the compressed flag to |
Definition at line 156 of file message.hpp.