79 namespace WebSocketClient {
113 timeout timeout_ms = DefaultTimeout;
118 const DefaultTimeout = 15s;
120 const Version =
"1.0";
122 const DefaultUserAgent =
sprintf(
"Qore-WebSocketClient/%s", WebSocketClient::Version);
231 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
272 private eventLoop(code callback);
275 private logInfo(
string fmt);
278 private logError(
string fmt);
281 private logDebug(
string fmt);
284 private sendClose(
int code, *
string txtmsg);
287 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:82
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:92
the main websocket client class
Definition: WebSocketClient.qm.dox.h:101
constructor(code callback, 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