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

NameDescription
this (opcode, payload) Build a WebSocket message.

Fields

NameTypeDescription
isValid boolIs this message valid?

Methods

NameDescription
as () Return the payload as a specific type.
asString () Return a string representation of the payload.