Loading...
Searching...
No Matches
WebSocketClient::WebSocketConnectionObject Class Reference

class for websocket connections; returns an object of class WebSocketClient for receiving websocket events from a websocket server More...

Inheritance diagram for WebSocketClient::WebSocketConnectionObject:
[legend]

## Public Member Functions

| constructor (string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
| creates the WebSocketConnectionObject connection object
DataProvider::AbstractDataProvider | getDataProvider ()
| returns an WebSocketClientDataProvider object for this connection
*hash< auto > | getRuntimeOptions ()
| returns runtime options
string | getType ()
| returns `"ws"`
bool | hasDataProvider ()
| returns True, as the connection returns a data provider with the getDataProvider() method

## Public Attributes

const | ConnectionScheme
| Connection entry info.

## Protected Member Functions

hash< ConnectionSchemeInfo > | getConnectionSchemeInfoImpl ()
| Returns the ConnectionSchemeInfo hash for this object.
WebSocketClient | getImpl (bool connect=True, *hash< auto > rtopts)
| returns a WebSocketClient object
| setChildCapabilities ()
| Sets child data provider capabilities.

## Detailed Description

class for websocket connections; returns an object of class WebSocketClient for receiving websocket events from a websocket server

supports the following options:

- `"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():

- `"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
- `"yield"`: a closure to yield current thread execution

## Member Function Documentation

## constructor()

WebSocketClient::WebSocketConnectionObject::constructor | ( | string | name,
|  | string | description,
|  | string | url,
|  | hash< auto > | attributes = `{}`,
|  | hash< auto > | options = `{}`
| ) |  |

creates the WebSocketConnectionObject 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

## getDataProvider()

DataProvider::AbstractDataProvider WebSocketClient::WebSocketConnectionObject::getDataProvider | ( |  | ) |

returns an WebSocketClientDataProvider object for this connection

Returns
  an WebSocketClientDataProvider object for this connection

See also
  hasDataProvider()

## getImpl()

WebSocketClient WebSocketClient::WebSocketConnectionObject::getImpl | ( | bool | connect = `True`,
|  | *hash< auto > | rtopts
| ) |  |

protectedvirtual

returns a WebSocketClient object

Parameters

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

  rtopts

  supports the following runtime options in getImpl():
  - `"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
  - `"yield"`: a closure to yield current thread execution

Returns
  a WebSocketClient object

Implements ConnectionProvider::AbstractConnection.

## getRuntimeOptions()

*hash< auto > WebSocketClient::WebSocketConnectionObject::getRuntimeOptions | ( |  | ) |

returns runtime options

Returns
  a hash with the following keys reflecting support for the corresponding runtime options in getImpl():
  - `"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
  - `"yield"`: a closure to yield current thread execution

## hasDataProvider()

bool WebSocketClient::WebSocketConnectionObject::hasDataProvider | ( |  | ) |

returns True, as the connection returns a data provider with the getDataProvider() method

Returns
  True, as the connection returns a data provider with the getDataProvider() method

See also
  getDataProvider()