SDK
SDK Dart Null Safety v3.x
2

Constructor #

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

Arguments #

Copied to clipboard!
WebSocketProtocol(
    Uri uri, {
    bool autoReconnect = true,
    Duration reconnectionDelay = const Duration(seconds: 1),
    int reconnectionAttempts = 10,
    Duration pingInterval,
  })

Argument Type Description
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
reconnectionAttempts
int
Maximum number of reconnection attempts, set to -1 for infinite retry
ssl
bool

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

Return #

A WebSocketProtocol protocol instance.

Usage #

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