WebSocket

Wrapper around a web socket.

Members

Functions

add
void add(string name, T data)

Adds context data to the web socket.

close
void close(short code, string reason)

Closes the web socket.

get
T get(string name, T defaultValue)

Gets the context data of the web socket.

read
T read()

Reads the current message as a generic data-type.

readBuffer
ubyte[] readBuffer()

Reads the current message as a buffer.

readBufferNext
bool readBufferNext(ubyte[] buffer)

Waits for the next message and reads it as a buffer.

readNext
bool readNext(T value)

Waits for the next message and reads it as a generic data-type.

readText
string readText()

Reads the current message as a text string.

readTextNext
bool readTextNext(string text)

Waits for the next message and reads it as a text string.

send
void send(T value)

Sends a generic data value to the web socket.

sendBuffer
void sendBuffer(ubyte[] buffer)

Sends a buffer to the web socket.

sendText
void sendText(string text)

Sends a text string to the web socket.

waitForData
bool waitForData()

Waits for data to be received.

Meta