![]() |
Qore DebugHandler Module Reference 0.2
|
The abstract web socket debug handler class. More...
Public Member Functions | |
| broadcastData (auto data) | |
| sends data to all connections | |
| 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 | |
| abstract | receiveData (hash cx, string msg) |
| called when web socket receives data | |
| sendData (hash cx, auto data) | |
| sends data to the given connection | |
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
| abstract DebugHandler::AbstractWebSocketDebugHandler::receiveData | ( | hash | cx, |
| string | msg ) |
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
| 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