| Qore SewioWebSocketClient Module Reference 1.2

SewioWebSocketClient Module

# Introduction to the SewioWebSocketClient Module

The SewioWebSocketClient module provides client support for RFC-6455 based WebSocket protocol implementations in Qore for Sewio.net's RTLS Studio servers.

To use this module, use `"%requires SewioWebSocketClient"` in your code.

This module automatically uses the WebSocketClient module for encoding and decoding web socket messages.

All the public symbols in the module are defined in the SewioWebSocketClient namespace.

Currently the module provides the following classes:

- SewioWebSocketClient: the Sewio RTLS Studio web socket client class
- SewioWebSocketConnection: the Sewio RTLS Studio web socket connection class (based on the ConnectionProvider module)

Example

#!/usr/bin/env qore
%new-style
%enable-all-warnings
%requires SewioWebSocketClient
*string url = shift ARGV;
*string apikey = shift ARGV;
if (!url || !apikey) {
stderr.printf("usage: %s <URL> <APIKEY>\n", get_script_name());
exit(1);
}
SewioWebSocketClient ws();
ws.connect(("url": url, "callback": sub (*data d) {if (d) printf("%s\n", d);}));
# wait forever (or until ctrl-c)
Counter c(1);
c.waitForZero();
get_script_name
*string get_script_name()
printf
string printf(string fmt,...)

# SewioWebSocketClient Module Release History

## v1.2

- implemented support for a data provider scheme cache and rich option information for connections (issue 4025)

## v1.1

- all connection clases have unified constructor

## v1.0

- the initial version of the SewioWebSocketClient module