WebSocketConnection

All the data that represents a WebSocket connection tracked by the WebSocketHandler.

Constructors

this
this(WebSocketMessageHandler messageHandler, WebSocketRequestHandler requestHandler, InputStream!ubyte inputStream, OutputStream!ubyte outputStream)
Undocumented in source.

Members

Functions

close
void close()

Closes this connection, if it's alive, sending a websocket close message.

getMessageHandler
WebSocketMessageHandler getMessageHandler()

Gets the message handler that handles events for this connection.

getRequestHandler
WebSocketRequestHandler getRequestHandler()

Gets the WebSocketRequestHandler that owns this connection. Use this to interact with the set of connections managed by that handler.

sendBinaryMessage
void sendBinaryMessage(ubyte[] bytes)

Sends a binary message to the connected client.

sendCloseMessage
void sendCloseMessage(WebSocketCloseStatusCode status, string message)

Sends a close message to the client, indicating that we'll be closing the connection.

sendTextMessage
void sendTextMessage(string text)

Sends a text message to the connected client.

Variables

id
UUID id;

The internal id assigned to this connection.

inputStream
InputStream!ubyte inputStream;

Stream for reading from the client.

outputStream
OutputStream!ubyte outputStream;

Stream for writing to the client.