Loading...
Searching...
No Matches
SewioWebSocketClient::SewioWebSocketConnection Class Reference

class for Sewio RTLS Studio websocket connections; returns an object of class SewioWebSocketClient for receiving websocket events from a Sewio RTLS Studio websocket server More...

## Public Member Functions

| constructor (hash< auto > config, *hash< auto > attr)
| creates the SewioWebSocketConnection object
| constructor (string name, string description, string url, hash attributes={}, hash options={})
| creates the SewioWebSocketConnection connection object
string | getType ()
| returns `"sewiows"`

## Public Attributes

const | ConnectionScheme = ...
| Connection entry info.
const | Options = map {$1: True}
| object connection options

## Protected Member Functions

hash< ConnectionSchemeInfo > | getConnectionSchemeInfoImpl ()
| Returns the ConnectionSchemeInfo hash for this object.
SewioWebSocketClient | getImpl (bool connect=True, *hash rtopts)
| returns a SewioWebSocketClient object

## Detailed Description

class for Sewio RTLS Studio websocket connections; returns an object of class SewioWebSocketClient for receiving websocket events from a Sewio RTLS Studio websocket server

supports the following options:

- `"apikey"`: (requried) the Sewio RTLS Studio API key to use for the connection
- `"connect_timeout"`: connection timeout to use in milliseconds
- `"http_version"`: HTTP version to use (`"1.0"` or `"1.1"`, defaults to `"1.1"`)
- `"max_redirects"`: maximum redirects to support
- `"proxy"`: proxy URL to use
- `"timeout"`: transfer timeout to use in milliseconds

also supports the following runtime options in getImpl() for connection logging:

- `"callback"`: (required) a callback to receive websocket events
- `"dbglog"`: a closure taking a single string for detailed technical connection logging
- `"errlog"`: a closure accepting a single string for error logging
- `"log"`: a closure accepting a single string for logging

## Member Function Documentation

## constructor() [1/2]

SewioWebSocketClient::SewioWebSocketConnection::constructor | ( | hash< auto > | config,
|  | *hash< auto > | attr )

creates the SewioWebSocketConnection object

Parameters

  config

  with the following keys:
  - name (required string): the connection name
  - display_name (optional string): the display name
  - short_desc (optional string): a short description in plain text
  - desc (optional string): a long description with markdown formatting
  - url (required string): the connection URL
  - opts (optional hash): connection options
  - logger (optional LoggerInterface object): logger for the connection

  attr

  optional connection attributes
  - monitor (optional bool): should the connection be monitored? Default: True
  - enabled (optional bool): is the connection enabled? Default: True
  - locked (optional bool): is the connection locked? Default: False
  - debug_data (optional bool): debug data? Default: False
  - tags (optional hash): tags for the connection; no default value

Exceptions

  CONNECTION-OPTION-ERROR | missing or invalid connection option or attribute

## constructor() [2/2]

SewioWebSocketClient::SewioWebSocketConnection::constructor | ( | string | name,
|  | string | description,
|  | string | url,
|  | hash | attributes = {},
|  | hash | options = {} )

creates the SewioWebSocketConnection connection object

Parameters

  name | the name of the connection
  description | connection description
  url | connection URL (potentially with password info)
  attributes | various attributes. See below
  options | connection options

See AbstractConnection::constructor() for `attributes` and `options` reference.

Exceptions

  CONNECTION-OPTION-ERROR | missing or invalid connection option

## getImpl()

SewioWebSocketClient SewioWebSocketClient::SewioWebSocketConnection::getImpl | ( | bool | connect = True,
|  | *hash | rtopts )

protected

returns a SewioWebSocketClient object

Parameters

  connect | if True, then WebSocketClient::connect() is called

  rtopts

  supports the following runtime options in getImpl() for connection logging:
  - `"log"`: a closure accepting a single string for logging
  - `"errlog"`: a closure accepting a single string for error logging
  - `"dbglog"`: a closure taking a single string for detailed technical connection logging

Returns
  a SewioWebSocketClient object