# OpenAsync Method

## Overloads

| [OpenAsync(Action<String>, Action<Exception>, CancellationToken)](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.IWebSocketSessionContainer.OpenAsync.htm#Qlik_Sense_JsonRpc_IWebSocketSessionContainer_OpenAsync_System_Action_System_String__System_Action_System_Exception__System_Threading_CancellationToken_) |  | Open a connection to a Qlik Sense instance based on the current location configuration and the argument session. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.IWebSocketSessionContainer.OpenAsync.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.IWebSocketSessionContainer.OpenAsync.htm)

## OpenAsync(Action&lt;String&gt;, Action&lt;Exception&gt;, CancellationToken)

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

### Declaration

```

          Task<WebSocketConnectionResults> OpenAsync(Action<string> onMessage, Action<Exception> onError, CancellationToken cancellationToken)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Action&lt;System.String&gt; | onMessage | Callback to active when messages are received from Qlik Sense. |
| System.Action&lt;System.Exception&gt; | 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&lt;[WebSocketConnectionResults](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.WebSocketConnectionResults.htm)&gt; | A task with the completion status of the connect operation as result. |