Qore DebugHandler Module Reference 0.1
|
The abstract web socket debug handler class. More...
#include <DebugHandler.qm.dox.h>
Public Member Methods | |
broadcastData (auto data) | |
sends data to all connections More... | |
abstract string | encodeData (auto data) |
encode websocket data | |
WebSocketHandler::WebSocketConnection | getConnectionImpl (hash cx, hash hdr, string cid) |
called when a connection is established; the default implementation creates a WebSocketConnection object | |
abstract *string | getContentType () |
returns the MIME type for serialized data | |
hash | handleRequest (hash cx, hash hdr, *data b) |
called by the HTTP server to handle incoming HTTP requests More... | |
abstract | receiveData (hash cx, string msg) |
called when web socket receives data More... | |
sendData (hash cx, auto data) | |
sends data to the given connection More... | |
The abstract web socket debug handler class.
Connections are represented by an object descended from WebSocketConnection which is instantiated via WebSocketHandler::WebSocketHandler::getConnectionImpl().
The handler is registered via HttpServer::setHandler() to receive messages.
Websocket connections are identified by their HTTP connection ID as passed in WebSocketHandler::handleRequest() in the "cx.id"
argument when the connection is first established.
DebugHandler::AbstractWebSocketDebugHandler::broadcastData | ( | auto | data | ) |
sends data to all connections
Encodes broadcasts data using WebSocketHandler::sendAll() to send a message to all connected clients
Override this method when implementing a 3rd party protocol
hash DebugHandler::AbstractWebSocketDebugHandler::handleRequest | ( | hash | cx, |
hash | hdr, | ||
*data | b | ||
) |
called by the HTTP server to handle incoming HTTP requests
It adds custom header X-QoreDebugWsProtocol
to the response
|
pure virtual |
called when web socket receives data
Data are passed as is, i.e. decoding is needed
Override this method when implementing a 3rd party protocol
Implemented in DebugHandler::WebSocketDebugHandler.
DebugHandler::AbstractWebSocketDebugHandler::sendData | ( | hash | cx, |
auto | data | ||
) |
sends data to the given connection
Encodes data and sends using WebSocketHandler::sendOne() to send a message to a single connection given its connection ID
Override this method when implementing a 3rd party protocol