# RpcConnection Class

Namespace: [Qlik.Sense.JsonRpc](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.htm)  
Assembly: Qlik.Sense.JsonRpc.dll

RpcConnection is responsible for handling the JsonRpc traffic to and from a Qlik Sense instance.

## Inheritance

* System.Object
  * RpcConnection

    [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.htm)
    #### Derived Classes
    * [QlikConnection](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.htm)

## Syntax

```
public class RpcConnection : IRpcConnection, IDisposable
```

## Constructors

| Name | Description |
| --- | --- |
| [RpcConnection(IGenericLocation, ISession)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.-ctor.htm#Qlik_Sense_JsonRpc_RpcConnection__ctor_Qlik_Sense_JsonRpc_IGenericLocation_Qlik_Sense_JsonRpc_ISession_) | Construct a new RpcConnection based on a Qlik Sense location object and a session specification. |

## Fields

| Name | Description |
| --- | --- |
| [RequireWebsocketCsrfToken](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.RequireWebsocketCsrfToken.htm) | Enforce use of csrf token for websocket connection. |

## Properties

| Name | Description |
| --- | --- |
| [CancellationToken](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.CancellationToken.htm#Qlik_Sense_JsonRpc_RpcConnection_CancellationToken) | The token used to synchronize shutdown events with all outstanding tasks |
| [ConnectionState](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.ConnectionState.htm#Qlik_Sense_JsonRpc_RpcConnection_ConnectionState) | Indicates session connection status. Can be used to identify if the connection resulted in the creation of a new session or if it attached to an already existing session. |
| [InboundSerializer](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.InboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_InboundSerializer) | The JsonSerializer used for deserializing incoming RPC messages. |
| [MaxJsonDepth](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.MaxJsonDepth.htm#Qlik_Sense_JsonRpc_RpcConnection_MaxJsonDepth) |  |
| [OutboundSerializer](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.OutboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_OutboundSerializer) | The JsonSerializer used for deserializing outgoing RPC messages. |
| [RetryCountLimit](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.RetryCountLimit.htm#Qlik_Sense_JsonRpc_RpcConnection_RetryCountLimit) | Maximum number of connection retry attempts performed when opening a websocket connection. |
| [ServerUri](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.ServerUri.htm#Qlik_Sense_JsonRpc_RpcConnection_ServerUri) | The Uri of the Qlik Sense server |
| [Session](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Session.htm#Qlik_Sense_JsonRpc_RpcConnection_Session) | The session specification. |
| [Timeout](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Timeout.htm#Qlik_Sense_JsonRpc_RpcConnection_Timeout) | Timeout value (in milliseconds) used for synchronous calls to engine. Usually used together<br>with [CancellationToken](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.CancellationToken.htm#Qlik_Sense_JsonRpc_RpcConnection_CancellationToken). |

## Methods

| Name | Description |
| --- | --- |
| [Deserialize<T>(JToken)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Deserialize.htm#Qlik_Sense_JsonRpc_RpcConnection_Deserialize__1_Newtonsoft_Json_Linq_JToken_) | Deserialize a token to a specific type. |
| [Dispose()](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Dispose.htm#Qlik_Sense_JsonRpc_RpcConnection_Dispose) | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| [Log(String)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Log.htm#Qlik_Sense_JsonRpc_RpcConnection_Log_System_String_) | Method to use when emitting a log message. |
| [Log(String, String)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Log.htm#Qlik_Sense_JsonRpc_RpcConnection_Log_System_String_System_String_) | Post message to the DebugConsole. If no debug console is active, then the method has no effect. |
| [MakeInboundSerializer()](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.MakeInboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_MakeInboundSerializer) | Method for creating the JsonSerializer used to deserialize message received from<br>the RPC connection. The method is called the first time the property<br>[InboundSerializer](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.InboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_InboundSerializer) is accessed, which is typically when<br>the method [Deserialize<T>(JToken)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.Deserialize.htm#Qlik_Sense_JsonRpc_RpcConnection_Deserialize__1_Newtonsoft_Json_Linq_JToken_) is called. |
| [MakeOutboundSerializer()](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.MakeOutboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_MakeOutboundSerializer) | Method for creating the JsonSerializer used to serialize requests to an<br>RPC connection. The method is called the first time the property<br>[OutboundSerializer](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.OutboundSerializer.htm#Qlik_Sense_JsonRpc_RpcConnection_OutboundSerializer) is accessed, which is typically when<br>the method [SendAsync<T>(Request)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.SendAsync.htm#Qlik_Sense_JsonRpc_RpcConnection_SendAsync__1_Qlik_Sense_JsonRpc_Request_) is called. |
| [SendAsync(Request)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.SendAsync.htm#Qlik_Sense_JsonRpc_RpcConnection_SendAsync_Qlik_Sense_JsonRpc_Request_) | Sends a request asynchronously to a Qlik Sense instance |
| [SendAsync<T>(Request)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.SendAsync.htm#Qlik_Sense_JsonRpc_RpcConnection_SendAsync__1_Qlik_Sense_JsonRpc_Request_) |  |
| [SendAsync<T>(Request, Func<Response, T>)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.SendAsync.htm#Qlik_Sense_JsonRpc_RpcConnection_SendAsync__1_Qlik_Sense_JsonRpc_Request_System_Func_Qlik_Sense_JsonRpc_Response___0__) | Sends a request asynchronously to a Qlik Sense instance with a specified response handler. |

## Events

| Name | Description |
| --- | --- |
| [CommunicationErrorEvent](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.CommunicationErrorEvent.htm) | Event that fires when an exception occurs on the web socket or the socket is<br>unexpectedly closed by the server. |
| [ConnectionClosingEvent](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.ConnectionClosingEvent.htm) | Event that fires when a connection closes. |
| [PushMessageEvent](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.PushMessageEvent.htm) | Will catch all responses without registered receiver |
| [PushMethodReceivedEvent](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.PushMethodReceivedEvent.htm) | Event that is fired whenever a push method is received from Qlik Sense. |
| [ResponseEvent](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.RpcConnection.ResponseEvent.htm) | Event that is fired when a response is received on the web socket. |