74 namespace WebSocketHandler {
92 const DefaultQueuePollingInterval = 500ms;
168 const DefaultSocketSendTimeout = 30s;
258 sendOne(softstring
id, data d);
267 static string getDataString(*data data);
*binary pollData()
this method is called by the WebSocketHandler to poll for messages from the client to send from the s...
*AbstractAuthenticator auth
logDebug(string fmt)
default implementation is empty
this class represents a connection to a websocket client
Definition: WebSocketHandler.qm.dox.h:85
*binary pollDataImmediate()
this method is called by the WebSocketHandler to poll for messages from the client to send from the s...
*list getConnectionIds()
get list of socket connection ids
hash handleRequest(hash cx, hash hdr, *data b)
called by the HTTP server to handle incoming HTTP requests
deregisterConnectionImpl(WebSocketConnection wsc)
called when the connection terminates; the default implementation does nothing
WebSocketConnection getConnectionImpl(hash cx, hash hdr, string cid)
called when a connection is established; the default implementation creates a WebSocketConnection obj...
startImpl(softstring lid, hash cx, hash hdr, Qore::Socket sock)
called from the HTTP server after the handleRequest() method indicates that a dedicated connection sh...
sendAll(data d)
sends a message to all connected clients
sendOne(softstring id, data d)
sends a message to the given connection ID
connectionClosed()
this method is called by the WebSocketHandler when the connection is closed
the main web socket handler class
Definition: WebSocketHandler.qm.dox.h:163
logError(string fmt)
default implementation is empty
send(data msg)
pushes an unencoded message on the connection's message queue; the message will be encoded with WebSo...
RWLock rwl()
connection read-write lock
hash ch
connection hash
Definition: WebSocketHandler.qm.dox.h:177
registered()
called when the connection has been registered in handler and accept sending messages (e...
gotMessage(string msg)
this method is called by the WebSocketHandler when messages from the client are received ...
constructor(*HttpServer::AbstractAuthenticator auth)
create the object optionally with the given AbstractAuthenticator
Qore::Thread::Queue queue()
the Queue object stores messages to be sent to the server
constructor(WebSocketHandler n_handler)
the constructor is called by the WebSocketHandler when a new connection is made by a websocket client...
logInfo(string fmt)
default implementation is empty
sendEncoded(binary msg)
pushes an already-encoded message on the connection's message queue