Struct WebSocketMessage
A low-level representation of a WebSocket message. Probably you don't need to use this directly.
struct WebSocketMessage
;
auto msg = WebSocketMessage("Hello world");
auto msg2 = WebSocketMessage(WebSocketMessage.OpCode.Text, "Hello world");
auto msg3 = WebSocketMessage(WebSocketMessage.OpCode.Ping, "Ping me back!");
auto msg4 = WebSocketMessage(WebSocketMessage.OpCode.Binary, [1, 2, 3, 4]);
Constructors
Name | Description |
this
(opcode, payload)
|
Build a WebSocket message.
|
Fields
Name | Type | Description |
isValid
|
bool | Is this message valid?
|
Methods
Name | Description |
as
()
|
Return the payload as a specific type.
|
asString
()
|
Return a string representation of the payload.
|