106 namespace WebSocketClient {
149 static Sequence seq();
285 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue,
auto arg, timeout min_ms = 1s);
331 eventLoop(code callback);
343 logError(
string fmt);
349 logDebug(
string fmt);
355 sendClose(
int code, *
string txtmsg);
361 hash connectUnlocked(*
hash hdr, *reference<hash> info);
461 hash<PingInfo> pingIntern(hash<PingInfo> rv);
hash connect(*hash opts, *reference< hash > info)
connects to the websocket server
string sprintf(string fmt,...)
*hash getRuntimeOptions()
returns runtime options
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
clearStats()
Clears performance statistics.
const WsSchemes
known websocket schemes
Definition: WebSocketClient.qm.dox.h:109
*code yield
callable object to yield the current thread's execution
Definition: WebSocketClient.qm.dox.h:147
int cid
unique websocket connection ID; -1 when not connected
Definition: WebSocketClient.qm.dox.h:145
int getConnectionId()
returns the unique connection ID
bool isOpen()
returns True if the connection is currently open and active, False if not
constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
creates the WebSocketConnectionObject object
const WsDefaultPort
default port for connections
Definition: WebSocketClient.qm.dox.h:119
destructor()
disconnects the connection and stops the event thread if connected
the main websocket client class
Definition: WebSocketClient.qm.dox.h:131
constructor(code cb, hash opts)
creates the object and optionally sets logging targets
string getType()
returns "websocket"
class for websocket connections; returns an object of class WebSocketClient for receiving websocket e...
Definition: WebSocketClient.qm.dox.h:405
static WebSocketConnectionObject make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
static constructor
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
send(string str)
Sends string data over the web socket with timeout specified in options; if any errors occur...
hash getOptions()
gets options
hash getSchemes()
returns a hash of URL scheme information for URL schemes supported by this object ...
pong()
Sends a PONG message to the server as a unidirectional keep-alive message.
disconnect(int cmd=WSCC_GoingAway)
disconnect with the given close code
const DefaultUserAgent
default user agent string for HTTP requests
Definition: WebSocketClient.qm.dox.h:161
*hash getDefaultOptions()
returns default options
const Version
module version
Definition: WebSocketClient.qm.dox.h:158
const DefaultTimeout
default socket I/O operation timeout: 15 seconds
Definition: WebSocketClient.qm.dox.h:155
WebSocketClient getImpl(bool connect=True, *hash rtopts)
returns a WebSocketClient object
hash getUsageInfo()
Returns performance statistics for the socket.