WebSocketSessionContainer Class

Namespace: Qlik.Sense.JsonRpc
Assembly: Qlik.Sense.JsonRpc.dll

Class responsible for managing web socket connections to Qlik Sense.

Inheritance

  • System.Object
    • WebSocketSessionContainer

Syntax

public class WebSocketSessionContainer : IWebSocketSessionContainer

Properties

IsConnected

True if websocket connection is open

Property Value
Type Description
System.Boolean

Methods

Close()

Close an open connection to a Qlik Sense instance. Operation has no effect if the connection is not open.

OpenAsync(Action<String>, Action<Exception>, CancellationToken)

Open a connection to a Qlik Sense instance based on the current location configuration and the argument session.

Parameters
Type Name Description
System.Action<System.String> onMessage

Callback to active when messages are received from Qlik Sense.

System.Action<System.Exception> onError

Callback to activate when an exception has occured on the web socket connection to Qlik Sense.

System.Threading.CancellationToken cancellationToken

The token used to synchronize shutdown events.

Returns
Type Description
System.Threading.Tasks.Task<WebSocketConnectionResults>

A task with the completion status of the connect operation as result.

SendMessage(String, Action<Exception>)

Send a message to a Qlik Sense instance.

Parameters
Type Name Description
System.String message

The message to send.

System.Action<System.Exception> onError

Callback when an error occurs during the send operation. Note that this callback is activated only if the send operation it self triggers an error. Errors returned by Qlik Sense as part of a response to a message should be captured by the onMessage callback provided as argument to OpenAsync(Action<String>, Action<Exception>, CancellationToken).

Exceptions

Type Condition
CommunicationErrorException

Thrown if connection is not open.

Implements

Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()