SDK
SDK Dart v2.x
2

Constructor #

Initializes a new instance of the WebSocket class pointing to the Kuzzle server specified by the uri.

Arguments #

WebSocketProtocol(
    Uri uri, {
    bool autoReconnect = true,
    Duration reconnectionDelay,
    Duration pingInterval,
  })

ArgumentTypeDescription
uri
Uri
URI pointing to a Kuzzle server
autoReconnect
bool
If true will automatically reconnect after a conneciton loss
port
int
Kuzzle port
reconnectionDelay
Duration
Time to wait before trying to reconnect
ssl
bool

(false)
If true will use SSL
pingInterval
Duration
Time to wait between each ping

Return #

A WebSocketProtocol protocol instance.

Usage #

final ws = new WebSocketProtocol(Uri(
    scheme: 'ws',
    host: 'localhost',
    port: 7512,
  ));