# HubAsync Method

## Overloads

| [HubAsync(ILocation, ISession)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.HubAsync.htm#Qlik_Engine_LocationExtensions_HubAsync_Qlik_Engine_ILocation_Qlik_Engine_ISession_) |  | Connect to the Qlik Sense hub.<br>This method opens a websocket connection. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.HubAsync.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.LocationExtensions.HubAsync.htm)

## HubAsync(ILocation, ISession)

Connect to the Qlik Sense hub. This method opens a websocket connection.

### Declaration

```

          public static Task<IHub> HubAsync(this ILocation location, ISession session = null)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [ILocation](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ILocation.htm) | location | Location object of the Qlik Sense instance |
| [ISession](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.ISession.htm) | session | Defines a specific app session, that can be connected to. |

### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task&lt;[IHub](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IHub.htm)&gt; | Returns a task, the result contains the IHub |