Qore DebugHandler Module Reference
0.1
|
The abstract web socket debug handler class. More...
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
Encode data and broadcast data using WebSocketHandler::sendAll() a message to all connected clients. Intercept method when implementing a 3rd party protocol.
called by the HTTP server to handle incoming HTTP requests
It adds custom header X-QoreDebugWsProtocol
to response
|
pure virtual |
called when web socket receives data
Data are passed as is, i.e. decoding is needed. Intercept method when implementing a 3rd party protocol.
Implemented in DebugHandler::WebSocketDebugHandler.
DebugHandler::AbstractWebSocketDebugHandler::sendData | ( | hash | cx, |
auto | data | ||
) |
sends data to the given connection
Encode data and send using WebSocketHandler::sendOne() a message to single connection given its connection ID. Intercept method when implementing a 3rd party protocol.