Constructor

Use this constructor to create a new instance of the SDK. Each instance represents a different connection to a Kuzzle server with specific options.

Arguments

Copied to clipboard!
public Kuzzle(
  AbstractProtocol networkProtocol,
  int refreshedTokenDuration = 3600000,
  int minTokenDuration = 3600000,
  int maxQueueSize = -1,
  int maxRequestDelay = 1000,
  bool autoRecover = false,
  Func<JObject, bool> queueFilter = null
)

Argument Type Description
networkProtocol
AbstractProtocol
Protocol used by the SDK instance
refreshedTokenDuration
int
Minimum duration of a Token after refresh (If set to -1 the SDK does not refresh the token automaticaly)
minTokenDuration
int
Minimum duration of a Token before being automatically refreshed (If set to -1 the SDK does not refresh the token automatically)
maxQueueSize
int
Maximum amount of elements that the queue can contains (If set to -1, the size is unlimited)
maxRequestDelay
int
Maximum delay between two requests to be replayed
queueFilter
Func<JObject, bool>
Function to filter the request queue before replaying requests
autoRecover
bool
Queue requests when network is down and automatically replay them when the SDK successfully reconnects

networkProtocol

The protocol used to connect to the Kuzzle instance. It can be one of the following available protocols:

Return

The Kuzzle SDK instance.

Usage

Copied to clipboard!
using System;
using KuzzleSdk;
using KuzzleSdk.Protocol;
WebSocket networkProtocol = new WebSocket(new Uri("ws://kuzzle:7512"));
KuzzleSdk.Kuzzle kuzzle = new KuzzleSdk.Kuzzle(networkProtocol);