#include <websocketmessage.h>
Public Member Functions | |
WebSocketMessage (const std::string &message, EWebSocketOPCode code, bool fin=true) | |
WebSocketMessage (std::string &&message, EWebSocketOPCode code, bool fin=true) | |
WebSocketMessage ()=delete | |
WebSocketMessage (WebSocketMessage &&other) | |
WebSocketMessage & | operator= (WebSocketMessage &&other) |
WebSocketMessage (const WebSocketMessage &other)=default | |
WebSocketMessage & | operator= (const WebSocketMessage &other)=default |
const std::string & | getPayload () const |
void | appendPayload (const std::string &payload) |
EWebSocketOPCode | getCode () const |
bool | getFin () const |
A web-socket message that is received by an end-point or sent to an end-point. Use the various constructors to construct your own message. The message can be sent using a nap::WebSocketClient or nap::WebSocketServer.
WebSocketMessage | ( | const std::string & | message, |
EWebSocketOPCode | code, | ||
bool | fin = true |
||
) |
Construct a new web socket message using the given payload, opcode and finalize bit flag.
message | the payload associated with this message. |
code | the op code that describes the intent of this message |
fin | if this is the final message |
WebSocketMessage | ( | std::string && | message, |
EWebSocketOPCode | code, | ||
bool | fin = true |
||
) |
Construct a new web socket message using the given payload, opcode and finalize bit flag.
message | the payload associated with this message. |
code | the op code that describes the intent of this message |
fin | if this is the final message |
|
delete |
WebSocketMessage | ( | WebSocketMessage && | other | ) |
|
default |
void appendPayload | ( | const std::string & | payload | ) |
Adds an extra set of characters to the already existing message.
payload | the data to append. |
EWebSocketOPCode getCode | ( | ) | const |
bool getFin | ( | ) | const |
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.
const std::string& getPayload | ( | ) | const |
|
default |
WebSocketMessage& operator= | ( | WebSocketMessage && | other | ) |