91 namespace WebSocketClient {
125 timeout timeout_ms = DefaultTimeout;
130 const DefaultTimeout = 15s;
132 const Version =
"1.0";
134 const DefaultUserAgent =
sprintf(
"Qore-WebSocketClient/%s", WebSocketClient::Version);
243 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
284 private eventLoop(code callback);
287 private logInfo(
string fmt);
290 private logError(
string fmt);
293 private logDebug(
string fmt);
296 private sendClose(
int code, *
string txtmsg);
299 private hash connectUnlocked(*
hash hdr, *reference info);
string sprintf(string fmt,...)
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, any arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
clearStats()
Clears performance statistics.
const WsSchemes
known websocket schemes
Definition: WebSocketClient.qm.dox.h:94
bool isOpen()
returns True if the connection is currently open and active, False if not
const WsDefaultPort
default port for connections
Definition: WebSocketClient.qm.dox.h:104
the main websocket client class
Definition: WebSocketClient.qm.dox.h:113
constructor(code cb, hash opts)
creates the object and optionally sets logging targets
disconnect(int cmd=WSCC_GoingAway)
disconnect with the given close code
hash getUsageInfo()
Returns performance statistics for the socket.
hash connect(*hash opts, *reference info)
connects to the websocket server